Class: GraphQL::Define::InstanceDefinable::AssignAttribute
- Inherits:
-
Object
- Object
- GraphQL::Define::InstanceDefinable::AssignAttribute
- Defined in:
- lib/graphql/define/instance_definable.rb
Instance Method Summary collapse
-
#call(defn, value) ⇒ Object
-
#initialize(attr_name) ⇒ AssignAttribute
constructor
A new instance of AssignAttribute.
Constructor Details
#initialize(attr_name) ⇒ AssignAttribute
Returns a new instance of AssignAttribute
290 291 292 |
# File 'lib/graphql/define/instance_definable.rb', line 290 def initialize(attr_name) @attr_assign_method = :"#{attr_name}=" end |
Instance Method Details
#call(defn, value) ⇒ Object
294 295 296 |
# File 'lib/graphql/define/instance_definable.rb', line 294 def call(defn, value) defn.public_send(@attr_assign_method, value) end |