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


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

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


525
526
527
# File 'lib/graphql/schema_comparator/changes.rb', line 525

def criticality
  @criticality
end

#enumObject (readonly)

Returns the value of attribute enum


525
526
527
# File 'lib/graphql/schema_comparator/changes.rb', line 525

def enum
  @enum
end

#new_enum_valueObject (readonly)

Returns the value of attribute new_enum_value


525
526
527
# File 'lib/graphql/schema_comparator/changes.rb', line 525

def new_enum_value
  @new_enum_value
end

#old_enum_valueObject (readonly)

Returns the value of attribute old_enum_value


525
526
527
# File 'lib/graphql/schema_comparator/changes.rb', line 525

def old_enum_value
  @old_enum_value
end

Instance Method Details

#messageObject


534
535
536
537
# File 'lib/graphql/schema_comparator/changes.rb', line 534

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