Class: GraphQL::SchemaComparator::Changes::DirectiveAdded

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(directive) ⇒ DirectiveAdded

Returns a new instance of DirectiveAdded.



697
698
699
700
# File 'lib/graphql/schema_comparator/changes.rb', line 697

def initialize(directive)
  @directive = directive
  @criticality = Changes::Criticality.non_breaking
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



695
696
697
# File 'lib/graphql/schema_comparator/changes.rb', line 695

def criticality
  @criticality
end

#directiveObject (readonly)

Returns the value of attribute directive.



695
696
697
# File 'lib/graphql/schema_comparator/changes.rb', line 695

def directive
  @directive
end

Instance Method Details

#messageObject



702
703
704
# File 'lib/graphql/schema_comparator/changes.rb', line 702

def message
  "Directive `#{directive.graphql_name}` was added"
end

#pathObject



706
707
708
# File 'lib/graphql/schema_comparator/changes.rb', line 706

def path
  "@#{directive.graphql_name}"
end