Class: GraphQL::Field::Resolve::MethodResolve
- Inherits:
-
BuiltInResolve
- Object
- BuiltInResolve
- GraphQL::Field::Resolve::MethodResolve
- Defined in:
- lib/graphql/field/resolve.rb
Overview
Resolve the field by public_send
ing @method_name
Instance Method Summary collapse
-
#call(obj, args, ctx) ⇒ Object
-
#initialize(field) ⇒ MethodResolve
constructor
A new instance of MethodResolve.
Constructor Details
#initialize(field) ⇒ MethodResolve
Returns a new instance of MethodResolve
26 27 28 |
# File 'lib/graphql/field/resolve.rb', line 26 def initialize(field) @method_name = field.property.to_sym end |
Instance Method Details
#call(obj, args, ctx) ⇒ Object
30 31 32 |
# File 'lib/graphql/field/resolve.rb', line 30 def call(obj, args, ctx) obj.public_send(@method_name) end |