Class: TinyGQL::Nodes::VariableDefinition
- Defined in:
- lib/tinygql/nodes.rb
Instance Attribute Summary collapse
-
#default_value ⇒ Object
readonly
Returns the value of attribute default_value.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(viz) ⇒ Object
- #children ⇒ Object
- #fold(viz, seed) ⇒ Object
-
#initialize(pos, variable, type, default_value) ⇒ VariableDefinition
constructor
A new instance of VariableDefinition.
- #variable_definition? ⇒ Boolean
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?, #line, #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?, #scalar_type_extension?, #schema_definition?, #string_value?, #type_condition?, #type_system_directive_location?, #union_type_definition?, #union_type_extension?, #value?, #variable?
Constructor Details
#initialize(pos, variable, type, default_value) ⇒ VariableDefinition
Returns a new instance of VariableDefinition.
207 208 209 210 211 212 |
# File 'lib/tinygql/nodes.rb', line 207 def initialize pos, variable, type, default_value super(pos) @variable = variable @type = type @default_value = default_value end |
Instance Attribute Details
#default_value ⇒ Object (readonly)
Returns the value of attribute default_value.
205 206 207 |
# File 'lib/tinygql/nodes.rb', line 205 def default_value @default_value end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
205 206 207 |
# File 'lib/tinygql/nodes.rb', line 205 def type @type end |
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
205 206 207 |
# File 'lib/tinygql/nodes.rb', line 205 def variable @variable end |
Instance Method Details
#accept(viz) ⇒ Object
214 215 216 |
# File 'lib/tinygql/nodes.rb', line 214 def accept viz viz.handle_variable_definition self end |
#children ⇒ Object
224 225 226 |
# File 'lib/tinygql/nodes.rb', line 224 def children ary = []; ary << variable; ary << type; ary << default_value if default_value; ary end |
#fold(viz, seed) ⇒ Object
218 219 220 |
# File 'lib/tinygql/nodes.rb', line 218 def fold viz, seed viz.handle_variable_definition self, seed end |
#variable_definition? ⇒ Boolean
222 |
# File 'lib/tinygql/nodes.rb', line 222 def variable_definition?; true; end |