Class: GraphQL::SchemaComparator::Changes::DirectiveDescriptionChanged

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(old_directive, new_directive) ⇒ DirectiveDescriptionChanged



717
718
719
720
721
# File 'lib/graphql/schema_comparator/changes.rb', line 717

def initialize(old_directive, new_directive)
  @criticality = Changes::Criticality.non_breaking
  @old_directive = old_directive
  @new_directive = new_directive
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



715
716
717
# File 'lib/graphql/schema_comparator/changes.rb', line 715

def criticality
  @criticality
end

#new_directiveObject (readonly)

Returns the value of attribute new_directive.



715
716
717
# File 'lib/graphql/schema_comparator/changes.rb', line 715

def new_directive
  @new_directive
end

#old_directiveObject (readonly)

Returns the value of attribute old_directive.



715
716
717
# File 'lib/graphql/schema_comparator/changes.rb', line 715

def old_directive
  @old_directive
end

Instance Method Details

#messageObject



723
724
725
726
# File 'lib/graphql/schema_comparator/changes.rb', line 723

def message
  "Directive `#{new_directive.name}` description changed"\
    " from `#{old_directive.description}` to `#{new_directive.description}`"
end

#pathObject



728
729
730
# File 'lib/graphql/schema_comparator/changes.rb', line 728

def path
  "@#{old_directive.name}"
end