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
- #path ⇒ 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.
752 753 754 755 756 757 |
# File 'lib/graphql/schema_comparator/changes.rb', line 752 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.
750 751 752 |
# File 'lib/graphql/schema_comparator/changes.rb', line 750 def criticality @criticality end |
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
750 751 752 |
# File 'lib/graphql/schema_comparator/changes.rb', line 750 def enum @enum end |
#new_enum_value ⇒ Object (readonly)
Returns the value of attribute new_enum_value.
750 751 752 |
# File 'lib/graphql/schema_comparator/changes.rb', line 750 def new_enum_value @new_enum_value end |
#old_enum_value ⇒ Object (readonly)
Returns the value of attribute old_enum_value.
750 751 752 |
# File 'lib/graphql/schema_comparator/changes.rb', line 750 def old_enum_value @old_enum_value end |
Instance Method Details
#message ⇒ Object
759 760 761 762 763 764 765 766 |
# File 'lib/graphql/schema_comparator/changes.rb', line 759 def if old_enum_value.deprecation_reason "Enum value `#{new_enum_value.path}` deprecation reason changed " \ "from `#{old_enum_value.deprecation_reason}` to `#{new_enum_value.deprecation_reason}`" else "Enum value `#{new_enum_value.path}` was deprecated with reason `#{new_enum_value.deprecation_reason}`" end end |
#path ⇒ Object
768 769 770 |
# File 'lib/graphql/schema_comparator/changes.rb', line 768 def path old_enum_value.path end |