Class: TinyGQL::Nodes::OperationDefinition

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?, #directive_definition?, #document?, #each, #enum_type_definition?, #enum_type_extension?, #enum_value?, #enum_value_definition?, #executable_directive_location?, #field?, #field_definition?, #float_value?, #fragment_definition?, #fragment_spread?, #inline_fragment?, #input_object_type_definition?, #input_object_type_extension?, #input_value_definition?, #int_value?, #interface_type_definition?, #interface_type_extension?, #list_type?, #list_value?, #named_type?, #not_null_type?, #null_value?, #object_field?, #object_type_definition?, #object_type_extension?, #object_value?, #root_operation_type_definition?, #scalar_type_definition?, #scalar_type_extension?, #schema_definition?, #string_value?, #type_condition?, #type_system_directive_location?, #union_type_definition?, #union_type_extension?, #value?, #variable?, #variable_definition?

Constructor Details

#initialize(type, name, variable_definitions, directives, selection_set) ⇒ OperationDefinition

Returns a new instance of OperationDefinition.



80
81
82
83
84
85
86
# File 'lib/tinygql/nodes.rb', line 80

def initialize type, name, variable_definitions, directives, selection_set
  @type = type
  @name = name
  @variable_definitions = variable_definitions
  @directives = directives
  @selection_set = selection_set
end

Instance Attribute Details

#directivesObject (readonly)

Returns the value of attribute directives.



78
79
80
# File 'lib/tinygql/nodes.rb', line 78

def directives
  @directives
end

#nameObject (readonly)

Returns the value of attribute name.



78
79
80
# File 'lib/tinygql/nodes.rb', line 78

def name
  @name
end

#selection_setObject (readonly)

Returns the value of attribute selection_set.



78
79
80
# File 'lib/tinygql/nodes.rb', line 78

def selection_set
  @selection_set
end

#typeObject (readonly)

Returns the value of attribute type.



78
79
80
# File 'lib/tinygql/nodes.rb', line 78

def type
  @type
end

#variable_definitionsObject (readonly)

Returns the value of attribute variable_definitions.



78
79
80
# File 'lib/tinygql/nodes.rb', line 78

def variable_definitions
  @variable_definitions
end

Instance Method Details

#accept(viz) ⇒ Object



88
89
90
# File 'lib/tinygql/nodes.rb', line 88

def accept viz
  viz.handle_operation_definition self
end

#childrenObject



98
99
100
# File 'lib/tinygql/nodes.rb', line 98

def children
  ary = []; ary.concat(variable_definitions) if variable_definitions; ary.concat(directives) if directives; ary.concat(selection_set); ary
end

#fold(viz, seed) ⇒ Object



92
93
94
# File 'lib/tinygql/nodes.rb', line 92

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

#operation_definition?Boolean

Returns:

  • (Boolean)


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

def operation_definition?; true; end