Class: TinyGQL::Nodes::DirectiveDefinition

Inherits:
Node
  • Object
show all
Defined in:
lib/tinygql/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#argument?, #boolean_value?, #directive?, #document?, #each, #enum_type_definition?, #enum_value?, #enum_value_definition?, #executable_directive_location?, #field?, #field_definition?, #float_value?, #fragment_definition?, #fragment_spread?, #inline_fragment?, #input_object_type_definition?, #input_value_definition?, #int_value?, #interface_type_definition?, #list_type?, #list_value?, #named_type?, #not_null_type?, #null_value?, #object_field?, #object_type_definition?, #object_type_extension?, #object_value?, #operation_definition?, #root_operation_type_definition?, #scalar_type_definition?, #schema_definition?, #string_value?, #type_condition?, #type_system_directive_location?, #union_type_definition?, #value?, #variable?, #variable_definition?

Constructor Details

#initialize(description, name, arguments_definition, directive_locations) ⇒ DirectiveDefinition

Returns a new instance of DirectiveDefinition.



848
849
850
851
852
853
# File 'lib/tinygql/nodes.rb', line 848

def initialize description, name, arguments_definition, directive_locations
  @description = description
  @name = name
  @arguments_definition = arguments_definition
  @directive_locations = directive_locations
end

Instance Attribute Details

#arguments_definitionObject (readonly)

Returns the value of attribute arguments_definition.



846
847
848
# File 'lib/tinygql/nodes.rb', line 846

def arguments_definition
  @arguments_definition
end

#descriptionObject (readonly)

Returns the value of attribute description.



846
847
848
# File 'lib/tinygql/nodes.rb', line 846

def description
  @description
end

#directive_locationsObject (readonly)

Returns the value of attribute directive_locations.



846
847
848
# File 'lib/tinygql/nodes.rb', line 846

def directive_locations
  @directive_locations
end

#nameObject (readonly)

Returns the value of attribute name.



846
847
848
# File 'lib/tinygql/nodes.rb', line 846

def name
  @name
end

Instance Method Details

#accept(viz) ⇒ Object



855
856
857
# File 'lib/tinygql/nodes.rb', line 855

def accept viz
  viz.handle_directive_definition self
end

#childrenObject



865
866
867
# File 'lib/tinygql/nodes.rb', line 865

def children
  ary = []; ary.concat(arguments_definition) if arguments_definition; ary.concat(directive_locations); ary
end

#directive_definition?Boolean

Returns:

  • (Boolean)


863
# File 'lib/tinygql/nodes.rb', line 863

def directive_definition? = true

#fold(viz, seed) ⇒ Object



859
860
861
# File 'lib/tinygql/nodes.rb', line 859

def fold viz, seed
  viz.handle_directive_definition self, seed
end