Class: GraphQL::Syntax::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/syntax/edge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier:, fields:, calls:) ⇒ Edge

Returns a new instance of Edge.



3
4
5
6
7
# File 'lib/graphql/syntax/edge.rb', line 3

def initialize(identifier:, fields:, calls:)
  @identifier = identifier
  @calls = calls
  @fields = fields
end

Instance Attribute Details

#callsObject (readonly)

Returns the value of attribute calls.



2
3
4
# File 'lib/graphql/syntax/edge.rb', line 2

def calls
  @calls
end

#fieldsObject (readonly)

Returns the value of attribute fields.



2
3
4
# File 'lib/graphql/syntax/edge.rb', line 2

def fields
  @fields
end

#identifierObject (readonly)

Returns the value of attribute identifier.



2
3
4
# File 'lib/graphql/syntax/edge.rb', line 2

def identifier
  @identifier
end

Instance Method Details

#call_hashObject



9
10
11
# File 'lib/graphql/syntax/edge.rb', line 9

def call_hash
  calls.inject({}) { |memo, call| memo[call.identifier] = call.argument; memo }
end