Class: GQL::Field::Method
- Inherits:
-
Object
- Object
- GQL::Field::Method
- Defined in:
- lib/gql/field.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) ⇒ Object
-
#initialize(target, context) ⇒ Method
constructor
A new instance of Method.
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
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/gql/field.rb', line 6 def context @context end |
#target ⇒ Object (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 |