Class: TinyGQL::Nodes::OperationDefinition
- Defined in:
- lib/tinygql/nodes.rb
Instance Attribute Summary collapse
-
#directives ⇒ Object
readonly
Returns the value of attribute directives.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#selection_set ⇒ Object
readonly
Returns the value of attribute selection_set.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#variable_definitions ⇒ Object
readonly
Returns the value of attribute variable_definitions.
Instance Method Summary collapse
- #accept(viz) ⇒ Object
- #children ⇒ Object
- #fold(viz, seed) ⇒ Object
-
#initialize(type, name, variable_definitions, directives, selection_set) ⇒ OperationDefinition
constructor
A new instance of OperationDefinition.
- #operation_definition? ⇒ Boolean
Methods inherited from Node
#argument?, #boolean_value?, #directive?, #directive_definition?, #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?, #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(type, name, variable_definitions, directives, selection_set) ⇒ OperationDefinition
Returns a new instance of OperationDefinition.
75 76 77 78 79 80 81 |
# File 'lib/tinygql/nodes.rb', line 75 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
#directives ⇒ Object (readonly)
Returns the value of attribute directives.
73 74 75 |
# File 'lib/tinygql/nodes.rb', line 73 def directives @directives end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
73 74 75 |
# File 'lib/tinygql/nodes.rb', line 73 def name @name end |
#selection_set ⇒ Object (readonly)
Returns the value of attribute selection_set.
73 74 75 |
# File 'lib/tinygql/nodes.rb', line 73 def selection_set @selection_set end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
73 74 75 |
# File 'lib/tinygql/nodes.rb', line 73 def type @type end |
#variable_definitions ⇒ Object (readonly)
Returns the value of attribute variable_definitions.
73 74 75 |
# File 'lib/tinygql/nodes.rb', line 73 def variable_definitions @variable_definitions end |
Instance Method Details
#accept(viz) ⇒ Object
83 84 85 |
# File 'lib/tinygql/nodes.rb', line 83 def accept viz viz.handle_operation_definition self end |
#children ⇒ Object
93 94 95 |
# File 'lib/tinygql/nodes.rb', line 93 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
87 88 89 |
# File 'lib/tinygql/nodes.rb', line 87 def fold viz, seed viz.handle_operation_definition self, seed end |
#operation_definition? ⇒ Boolean
91 |
# File 'lib/tinygql/nodes.rb', line 91 def operation_definition? = true |