Class: GQL::Field::Method

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, context) ⇒ Method

Returns a new instance of Method.



8
9
10
# File 'lib/gql/field.rb', line 8

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

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#targetObject (readonly)

Returns the value of attribute target.



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

def target
  @target
end

Instance Method Details

#execute(method) ⇒ Object



12
13
14
# File 'lib/gql/field.rb', line 12

def execute(method)
  instance_exec(&method)
end