class GraphQL::Define::InstanceDefinable::AssignAttribute
Public Class Methods
new(attr_name)
click to toggle source
# File lib/graphql/define/instance_definable.rb, line 241 def initialize(attr_name) @attr_assign_method = :"#{attr_name}=" end
Public Instance Methods
call(defn, *value)
click to toggle source
Even though we're just using the first value here, We have to add a splat here to use `ruby2_keywords`, so that it will accept a `[{}]` input from the caller.
# File lib/graphql/define/instance_definable.rb, line 248 def call(defn, *value) defn.public_send(@attr_assign_method, value.first) end