Class: GraphQLIncludable::Relay::EdgeWithNode

Inherits:
GraphQL::Relay::Edge
  • Object
show all
Defined in:
lib/graphql_includable/relay/edge_with_node.rb

Instance Method Summary collapse

Constructor Details

#initialize(node, connection) ⇒ EdgeWithNode

Returns a new instance of EdgeWithNode.



4
5
6
7
8
# File 'lib/graphql_includable/relay/edge_with_node.rb', line 4

def initialize(node, connection)
  @edge = node
  node = connection.edge_to_node(@edge) # TODO: Make lazy
  super(node, connection)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/graphql_includable/relay/edge_with_node.rb', line 10

def method_missing(method_name, *args, &block)
  if @edge.respond_to?(method_name)
    @edge.send(method_name, *args, &block)
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/graphql_includable/relay/edge_with_node.rb', line 18

def respond_to_missing?(method_name, include_private = false)
  @edge.respond_to?(method_name) || super
end