Class: GQL::Call::Method

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, context) ⇒ Method

Returns a new instance of Method.



6
7
8
# File 'lib/gql/call.rb', line 6

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

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



4
5
6
# File 'lib/gql/call.rb', line 4

def context
  @context
end

#targetObject (readonly)

Returns the value of attribute target.



4
5
6
# File 'lib/gql/call.rb', line 4

def target
  @target
end

Instance Method Details

#execute(method, args) ⇒ Object



10
11
12
# File 'lib/gql/call.rb', line 10

def execute(method, args)
  instance_exec(*args, &method)
end