Class: Graphlyte::Schema::TypeRef
Overview
A type ref names a run-time type See ‘Type` for the full type definition.
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#name ⇒ Object
Returns the value of attribute name.
-
#of_type ⇒ Object
Returns the value of attribute of_type.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Data
#==, attr_accessor, attr_reader, attributes, #dup, #eql?, #hash, #initialize, #inspect
Constructor Details
This class inherits a constructor from Graphlyte::Data
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind.
49 50 51 |
# File 'lib/graphlyte/schema.rb', line 49 def kind @kind end |
#name ⇒ Object
Returns the value of attribute name.
49 50 51 |
# File 'lib/graphlyte/schema.rb', line 49 def name @name end |
#of_type ⇒ Object
Returns the value of attribute of_type.
49 50 51 |
# File 'lib/graphlyte/schema.rb', line 49 def of_type @of_type end |
Class Method Details
.from_schema_response(data) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/graphlyte/schema.rb', line 51 def self.from_schema_response(data) return unless data ref = new ref.name = data['name'] ref.kind = data['kind'].to_sym ref.of_type = TypeRef.from_schema_response(data['ofType']) ref end |
Instance Method Details
#unpack ⇒ Object
63 64 65 66 67 |
# File 'lib/graphlyte/schema.rb', line 63 def unpack return of_type.unpack if of_type name end |