Class: GraphQL::SchemaComparator::Changes::EnumValueDescriptionChanged

Inherits:
AbstractChange
  • Object
show all
Defined in:
lib/graphql/schema_comparator/changes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(enum, old_enum_value, new_enum_value) ⇒ EnumValueDescriptionChanged

Returns a new instance of EnumValueDescriptionChanged.



732
733
734
735
736
737
# File 'lib/graphql/schema_comparator/changes.rb', line 732

def initialize(enum, old_enum_value, new_enum_value)
  @enum = enum
  @old_enum_value = old_enum_value
  @new_enum_value = new_enum_value
  @criticality = Changes::Criticality.non_breaking
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



730
731
732
# File 'lib/graphql/schema_comparator/changes.rb', line 730

def criticality
  @criticality
end

#enumObject (readonly)

Returns the value of attribute enum.



730
731
732
# File 'lib/graphql/schema_comparator/changes.rb', line 730

def enum
  @enum
end

#new_enum_valueObject (readonly)

Returns the value of attribute new_enum_value.



730
731
732
# File 'lib/graphql/schema_comparator/changes.rb', line 730

def new_enum_value
  @new_enum_value
end

#old_enum_valueObject (readonly)

Returns the value of attribute old_enum_value.



730
731
732
# File 'lib/graphql/schema_comparator/changes.rb', line 730

def old_enum_value
  @old_enum_value
end

Instance Method Details

#messageObject



739
740
741
742
# File 'lib/graphql/schema_comparator/changes.rb', line 739

def message
  "Description for enum value `#{new_enum_value.path}` changed from " \
    "`#{old_enum_value.description}` to `#{new_enum_value.description}`"
end

#pathObject



744
745
746
# File 'lib/graphql/schema_comparator/changes.rb', line 744

def path
  old_enum_value.path
end