Class: GraphQL::SchemaComparator::Changes::EnumValueRemoved

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_type, enum_value) ⇒ EnumValueRemoved

Returns a new instance of EnumValueRemoved.



98
99
100
101
102
# File 'lib/graphql/schema_comparator/changes.rb', line 98

def initialize(enum_type, enum_value)
  @enum_value = enum_value
  @enum_type = enum_type
  @criticality = Changes::Criticality.breaking
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



96
97
98
# File 'lib/graphql/schema_comparator/changes.rb', line 96

def criticality
  @criticality
end

#enum_typeObject (readonly)

Returns the value of attribute enum_type.



96
97
98
# File 'lib/graphql/schema_comparator/changes.rb', line 96

def enum_type
  @enum_type
end

#enum_valueObject (readonly)

Returns the value of attribute enum_value.



96
97
98
# File 'lib/graphql/schema_comparator/changes.rb', line 96

def enum_value
  @enum_value
end

Instance Method Details

#messageObject



104
105
106
# File 'lib/graphql/schema_comparator/changes.rb', line 104

def message
  "Enum value `#{enum_value.name}` was removed from enum `#{enum_type.name}`"
end

#pathObject



108
109
110
# File 'lib/graphql/schema_comparator/changes.rb', line 108

def path
  [enum_type.name, enum_value.name].join('.')
end