Class: GQL::Node::ExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/gql/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, context) ⇒ ExecutionContext

Returns a new instance of ExecutionContext.



11
12
13
# File 'lib/gql/node.rb', line 11

def initialize(target, context)
  @target, @context = target, context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



9
10
11
# File 'lib/gql/node.rb', line 9

def context
  @context
end

#targetObject (readonly)

Returns the value of attribute target.



9
10
11
# File 'lib/gql/node.rb', line 9

def target
  @target
end

Instance Method Details

#execute(method, args = []) ⇒ Object



15
16
17
# File 'lib/gql/node.rb', line 15

def execute(method, args = [])
  instance_exec(*args, &method)
end