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.



531
532
533
534
535
536
# File 'lib/graphql/schema_comparator/changes.rb', line 531

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.



529
530
531
# File 'lib/graphql/schema_comparator/changes.rb', line 529

def criticality
  @criticality
end

#enumObject (readonly)

Returns the value of attribute enum.



529
530
531
# File 'lib/graphql/schema_comparator/changes.rb', line 529

def enum
  @enum
end

#new_enum_valueObject (readonly)

Returns the value of attribute new_enum_value.



529
530
531
# File 'lib/graphql/schema_comparator/changes.rb', line 529

def new_enum_value
  @new_enum_value
end

#old_enum_valueObject (readonly)

Returns the value of attribute old_enum_value.



529
530
531
# File 'lib/graphql/schema_comparator/changes.rb', line 529

def old_enum_value
  @old_enum_value
end

Instance Method Details

#messageObject



538
539
540
541
# File 'lib/graphql/schema_comparator/changes.rb', line 538

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