Class: GQL::Fields::Object
- Inherits:
-
GQL::Field
- Object
- Node
- GQL::Field
- GQL::Fields::Object
- Defined in:
- lib/gql/fields/object.rb
Instance Attribute Summary
Attributes inherited from Node
#ast_node, #context, #target, #variables
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Node
call, cursor, field, #initialize, method_missing, #value_of_call, #value_of_field, #value_of_fields
Constructor Details
This class inherits a constructor from GQL::Node
Class Method Details
.build_class(method, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/gql/fields/object.rb', line 9 def build_class(method, = {}) node_class = [:node_class] || self.node_class if node_class.nil? raise Errors::UndefinedNodeClass.new(self, 'node') end unless node_class <= GQL::Node raise Errors::InvalidNodeClass.new(node_class, GQL::Node) end Class.new(self).tap do |field_class| field_class.method = method field_class.node_class = node_class end end |