Class: GraphQL::SchemaComparator::Changes::EnumValueDeprecated
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::EnumValueDeprecated
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
-
#new_enum_value ⇒ Object
readonly
Returns the value of attribute new_enum_value.
-
#old_enum_value ⇒ Object
readonly
Returns the value of attribute old_enum_value.
Instance Method Summary collapse
-
#initialize(enum, old_enum_value, new_enum_value) ⇒ EnumValueDeprecated
constructor
A new instance of EnumValueDeprecated.
- #message ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(enum, old_enum_value, new_enum_value) ⇒ EnumValueDeprecated
Returns a new instance of EnumValueDeprecated.
543 544 545 546 547 548 |
# File 'lib/graphql/schema_comparator/changes.rb', line 543 def initialize(enum, old_enum_value, new_enum_value) @criticality = Changes::Criticality.non_breaking @enum = enum @old_enum_value = old_enum_value @new_enum_value = new_enum_value end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
541 542 543 |
# File 'lib/graphql/schema_comparator/changes.rb', line 541 def criticality @criticality end |
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
541 542 543 |
# File 'lib/graphql/schema_comparator/changes.rb', line 541 def enum @enum end |
#new_enum_value ⇒ Object (readonly)
Returns the value of attribute new_enum_value.
541 542 543 |
# File 'lib/graphql/schema_comparator/changes.rb', line 541 def new_enum_value @new_enum_value end |
#old_enum_value ⇒ Object (readonly)
Returns the value of attribute old_enum_value.
541 542 543 |
# File 'lib/graphql/schema_comparator/changes.rb', line 541 def old_enum_value @old_enum_value end |
Instance Method Details
#message ⇒ Object
550 551 552 553 554 555 556 557 558 |
# File 'lib/graphql/schema_comparator/changes.rb', line 550 def if old_enum_value.deprecation_reason "Enum value `#{enum.name}.#{new_enum_value.name}` deprecation reason changed " \ "from `#{old_enum_value.deprecation_reason}` to `#{new_enum_value.deprecation_reason}`" else "Enum value `#{enum.name}.#{new_enum_value.name}` was deprecated with reason" \ " `#{new_enum_value.deprecation_reason}`" end end |