Class: GraphQL::Define::InstanceDefinable::AssignAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/define/instance_definable.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr_name) ⇒ AssignAttribute

Returns a new instance of AssignAttribute


217
218
219
# File 'lib/graphql/define/instance_definable.rb', line 217

def initialize(attr_name)
  @attr_assign_method = :"#{attr_name}="
end

Instance Method Details

#call(defn, value) ⇒ Object


221
222
223
# File 'lib/graphql/define/instance_definable.rb', line 221

def call(defn, value)
  defn.public_send(@attr_assign_method, value)
end