Class: GQL::Call::Method
- Inherits:
-
Object
- Object
- GQL::Call::Method
- Defined in:
- lib/gql/call.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #execute(method, args) ⇒ Object
-
#initialize(target, context) ⇒ Method
constructor
A new instance of Method.
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
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/gql/call.rb', line 4 def context @context end |
#target ⇒ Object (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 |