Module: TinyGQL::Visitors::Visitor
- Defined in:
- lib/tinygql/visitors.rb
Instance Method Summary collapse
- #handle_argument(obj) ⇒ Object
- #handle_boolean_value(obj) ⇒ Object
- #handle_directive(obj) ⇒ Object
- #handle_directive_definition(obj) ⇒ Object
- #handle_document(obj) ⇒ Object
- #handle_enum_type_definition(obj) ⇒ Object
- #handle_enum_type_extension(obj) ⇒ Object
- #handle_enum_value(obj) ⇒ Object
- #handle_enum_value_definition(obj) ⇒ Object
- #handle_executable_directive_location(obj) ⇒ Object
- #handle_field(obj) ⇒ Object
- #handle_field_definition(obj) ⇒ Object
- #handle_float_value(obj) ⇒ Object
- #handle_fragment_definition(obj) ⇒ Object
- #handle_fragment_spread(obj) ⇒ Object
- #handle_inline_fragment(obj) ⇒ Object
- #handle_input_object_type_definition(obj) ⇒ Object
- #handle_input_object_type_extension(obj) ⇒ Object
- #handle_input_value_definition(obj) ⇒ Object
- #handle_int_value(obj) ⇒ Object
- #handle_interface_type_definition(obj) ⇒ Object
- #handle_interface_type_extension(obj) ⇒ Object
- #handle_list_type(obj) ⇒ Object
- #handle_list_value(obj) ⇒ Object
- #handle_named_type(obj) ⇒ Object
- #handle_not_null_type(obj) ⇒ Object
- #handle_null_value(obj) ⇒ Object
- #handle_object_field(obj) ⇒ Object
- #handle_object_type_definition(obj) ⇒ Object
- #handle_object_type_extension(obj) ⇒ Object
- #handle_object_value(obj) ⇒ Object
- #handle_operation_definition(obj) ⇒ Object
- #handle_root_operation_type_definition(obj) ⇒ Object
- #handle_scalar_type_definition(obj) ⇒ Object
- #handle_scalar_type_extension(obj) ⇒ Object
- #handle_schema_definition(obj) ⇒ Object
- #handle_string_value(obj) ⇒ Object
- #handle_type_condition(obj) ⇒ Object
- #handle_type_system_directive_location(obj) ⇒ Object
- #handle_union_type_definition(obj) ⇒ Object
- #handle_union_type_extension(obj) ⇒ Object
- #handle_value(obj) ⇒ Object
- #handle_variable(obj) ⇒ Object
- #handle_variable_definition(obj) ⇒ Object
Instance Method Details
#handle_argument(obj) ⇒ Object
38 39 40 |
# File 'lib/tinygql/visitors.rb', line 38 def handle_argument obj obj.value.accept(self) end |
#handle_boolean_value(obj) ⇒ Object
61 62 |
# File 'lib/tinygql/visitors.rb', line 61 def handle_boolean_value obj end |
#handle_directive(obj) ⇒ Object
77 78 79 |
# File 'lib/tinygql/visitors.rb', line 77 def handle_directive obj obj.arguments.each { |v| v.accept self } if obj.arguments end |
#handle_directive_definition(obj) ⇒ Object
179 180 181 182 183 |
# File 'lib/tinygql/visitors.rb', line 179 def handle_directive_definition obj obj.description.accept(self) if obj.description obj.arguments_definition.each { |v| v.accept self } if obj.arguments_definition obj.directive_locations.each { |v| v.accept self } end |
#handle_document(obj) ⇒ Object
5 6 7 |
# File 'lib/tinygql/visitors.rb', line 5 def handle_document obj obj.definitions.each { |v| v.accept self } end |
#handle_enum_type_definition(obj) ⇒ Object
155 156 157 158 159 |
# File 'lib/tinygql/visitors.rb', line 155 def handle_enum_type_definition obj obj.description.accept(self) if obj.description obj.directives.each { |v| v.accept self } if obj.directives obj.enum_value_definition.each { |v| v.accept self } if obj.enum_value_definition end |
#handle_enum_type_extension(obj) ⇒ Object
200 201 202 203 |
# File 'lib/tinygql/visitors.rb', line 200 def handle_enum_type_extension obj obj.directives.each { |v| v.accept self } if obj.directives obj.enum_value_definition.each { |v| v.accept self } if obj.enum_value_definition end |
#handle_enum_value(obj) ⇒ Object
67 68 |
# File 'lib/tinygql/visitors.rb', line 67 def handle_enum_value obj end |
#handle_enum_value_definition(obj) ⇒ Object
149 150 151 152 153 |
# File 'lib/tinygql/visitors.rb', line 149 def handle_enum_value_definition obj obj.description.accept(self) if obj.description obj.enum_value.accept(self) obj.directives.each { |v| v.accept self } if obj.directives end |
#handle_executable_directive_location(obj) ⇒ Object
173 174 |
# File 'lib/tinygql/visitors.rb', line 173 def handle_executable_directive_location obj end |
#handle_field(obj) ⇒ Object
42 43 44 45 46 |
# File 'lib/tinygql/visitors.rb', line 42 def handle_field obj obj.arguments.each { |v| v.accept self } if obj.arguments obj.directives.each { |v| v.accept self } if obj.directives obj.selection_set.each { |v| v.accept self } if obj.selection_set end |
#handle_field_definition(obj) ⇒ Object
111 112 113 114 115 116 |
# File 'lib/tinygql/visitors.rb', line 111 def handle_field_definition obj obj.description.accept(self) if obj.description obj.arguments_definition.each { |v| v.accept self } if obj.arguments_definition obj.type.accept(self) obj.directives.each { |v| v.accept self } if obj.directives end |
#handle_float_value(obj) ⇒ Object
55 56 |
# File 'lib/tinygql/visitors.rb', line 55 def handle_float_value obj end |
#handle_fragment_definition(obj) ⇒ Object
95 96 97 98 99 |
# File 'lib/tinygql/visitors.rb', line 95 def handle_fragment_definition obj obj.type_condition.accept(self) obj.directives.each { |v| v.accept self } if obj.directives obj.selection_set.each { |v| v.accept self } end |
#handle_fragment_spread(obj) ⇒ Object
91 92 93 |
# File 'lib/tinygql/visitors.rb', line 91 def handle_fragment_spread obj obj.directives.each { |v| v.accept self } if obj.directives end |
#handle_inline_fragment(obj) ⇒ Object
85 86 87 88 89 |
# File 'lib/tinygql/visitors.rb', line 85 def handle_inline_fragment obj obj.type_condition.accept(self) if obj.type_condition obj.directives.each { |v| v.accept self } if obj.directives obj.selection_set.each { |v| v.accept self } end |
#handle_input_object_type_definition(obj) ⇒ Object
161 162 163 164 165 |
# File 'lib/tinygql/visitors.rb', line 161 def handle_input_object_type_definition obj obj.description.accept(self) if obj.description obj.directives.each { |v| v.accept self } if obj.directives obj.input_fields_definition.each { |v| v.accept self } if obj.input_fields_definition end |
#handle_input_object_type_extension(obj) ⇒ Object
205 206 207 208 |
# File 'lib/tinygql/visitors.rb', line 205 def handle_input_object_type_extension obj obj.directives.each { |v| v.accept self } if obj.directives obj.input_fields_definition.each { |v| v.accept self } if obj.input_fields_definition end |
#handle_input_value_definition(obj) ⇒ Object
118 119 120 121 122 123 |
# File 'lib/tinygql/visitors.rb', line 118 def handle_input_value_definition obj obj.description.accept(self) if obj.description obj.type.accept(self) obj.default_value.accept(self) if obj.default_value obj.directives.each { |v| v.accept self } if obj.directives end |
#handle_int_value(obj) ⇒ Object
52 53 |
# File 'lib/tinygql/visitors.rb', line 52 def handle_int_value obj end |
#handle_interface_type_definition(obj) ⇒ Object
132 133 134 135 136 |
# File 'lib/tinygql/visitors.rb', line 132 def handle_interface_type_definition obj obj.description.accept(self) if obj.description obj.directives.each { |v| v.accept self } if obj.directives obj.fields_definition.each { |v| v.accept self } if obj.fields_definition end |
#handle_interface_type_extension(obj) ⇒ Object
189 190 191 192 193 |
# File 'lib/tinygql/visitors.rb', line 189 def handle_interface_type_extension obj obj.implements_interfaces.each { |v| v.accept self } if obj.implements_interfaces obj.directives.each { |v| v.accept self } if obj.directives obj.fields_definition.each { |v| v.accept self } if obj.fields_definition end |
#handle_list_type(obj) ⇒ Object
25 26 27 |
# File 'lib/tinygql/visitors.rb', line 25 def handle_list_type obj obj.type.accept(self) end |
#handle_list_value(obj) ⇒ Object
70 71 |
# File 'lib/tinygql/visitors.rb', line 70 def handle_list_value obj end |
#handle_named_type(obj) ⇒ Object
18 19 |
# File 'lib/tinygql/visitors.rb', line 18 def handle_named_type obj end |
#handle_not_null_type(obj) ⇒ Object
21 22 23 |
# File 'lib/tinygql/visitors.rb', line 21 def handle_not_null_type obj obj.type.accept(self) end |
#handle_null_value(obj) ⇒ Object
64 65 |
# File 'lib/tinygql/visitors.rb', line 64 def handle_null_value obj end |
#handle_object_field(obj) ⇒ Object
48 49 50 |
# File 'lib/tinygql/visitors.rb', line 48 def handle_object_field obj obj.value.accept(self) end |
#handle_object_type_definition(obj) ⇒ Object
125 126 127 128 129 130 |
# File 'lib/tinygql/visitors.rb', line 125 def handle_object_type_definition obj obj.description.accept(self) if obj.description obj.implements_interfaces.each { |v| v.accept self } if obj.implements_interfaces obj.directives.each { |v| v.accept self } if obj.directives obj.fields_definition.each { |v| v.accept self } if obj.fields_definition end |
#handle_object_type_extension(obj) ⇒ Object
167 168 169 170 171 |
# File 'lib/tinygql/visitors.rb', line 167 def handle_object_type_extension obj obj.implements_interfaces.each { |v| v.accept self } if obj.implements_interfaces obj.directives.each { |v| v.accept self } if obj.directives obj.fields_definition.each { |v| v.accept self } if obj.fields_definition end |
#handle_object_value(obj) ⇒ Object
73 74 75 |
# File 'lib/tinygql/visitors.rb', line 73 def handle_object_value obj obj.values.each { |v| v.accept self } end |
#handle_operation_definition(obj) ⇒ Object
9 10 11 12 13 |
# File 'lib/tinygql/visitors.rb', line 9 def handle_operation_definition obj obj.variable_definitions.each { |v| v.accept self } if obj.variable_definitions obj.directives.each { |v| v.accept self } if obj.directives obj.selection_set.each { |v| v.accept self } end |
#handle_root_operation_type_definition(obj) ⇒ Object
101 102 103 |
# File 'lib/tinygql/visitors.rb', line 101 def handle_root_operation_type_definition obj obj.named_type.accept(self) end |
#handle_scalar_type_definition(obj) ⇒ Object
144 145 146 147 |
# File 'lib/tinygql/visitors.rb', line 144 def handle_scalar_type_definition obj obj.description.accept(self) if obj.description obj.directives.each { |v| v.accept self } if obj.directives end |
#handle_scalar_type_extension(obj) ⇒ Object
185 186 187 |
# File 'lib/tinygql/visitors.rb', line 185 def handle_scalar_type_extension obj obj.directives.each { |v| v.accept self } if obj.directives end |
#handle_schema_definition(obj) ⇒ Object
105 106 107 108 109 |
# File 'lib/tinygql/visitors.rb', line 105 def handle_schema_definition obj obj.description.accept(self) if obj.description obj.directives.each { |v| v.accept self } if obj.directives obj.root_operation_definitions.each { |v| v.accept self } end |
#handle_string_value(obj) ⇒ Object
58 59 |
# File 'lib/tinygql/visitors.rb', line 58 def handle_string_value obj end |
#handle_type_condition(obj) ⇒ Object
81 82 83 |
# File 'lib/tinygql/visitors.rb', line 81 def handle_type_condition obj obj.named_type.accept(self) end |
#handle_type_system_directive_location(obj) ⇒ Object
176 177 |
# File 'lib/tinygql/visitors.rb', line 176 def handle_type_system_directive_location obj end |
#handle_union_type_definition(obj) ⇒ Object
138 139 140 141 142 |
# File 'lib/tinygql/visitors.rb', line 138 def handle_union_type_definition obj obj.description.accept(self) if obj.description obj.directives.each { |v| v.accept self } if obj.directives obj.union_member_types.each { |v| v.accept self } if obj.union_member_types end |
#handle_union_type_extension(obj) ⇒ Object
195 196 197 198 |
# File 'lib/tinygql/visitors.rb', line 195 def handle_union_type_extension obj obj.directives.each { |v| v.accept self } if obj.directives obj.union_member_types.each { |v| v.accept self } if obj.union_member_types end |
#handle_value(obj) ⇒ Object
35 36 |
# File 'lib/tinygql/visitors.rb', line 35 def handle_value obj end |
#handle_variable(obj) ⇒ Object
15 16 |
# File 'lib/tinygql/visitors.rb', line 15 def handle_variable obj end |
#handle_variable_definition(obj) ⇒ Object
29 30 31 32 33 |
# File 'lib/tinygql/visitors.rb', line 29 def handle_variable_definition obj obj.variable.accept(self) obj.type.accept(self) obj.default_value.accept(self) if obj.default_value end |