class Unparser::Anima::Attribute
An attribute
def get(object)
-
(Object)
-
Parameters:
-
object
(Object
) --
def get(object) object.public_send(name) end
def initialize(name)
-
name
(Symbol
) --
def initialize(name) @name = name @instance_variable_name = :"@#{name}" end
def load(object, attributes)
-
(self)
-
Parameters:
-
attributes
(Hash
) -- -
object
(Object
) --
def load(object, attributes) set(object, attributes.fetch(name)) end
def set(object, value)
-
(self)
-
Parameters:
-
value
(Object
) -- -
object
(Object
) --
def set(object, value) object.instance_variable_set(instance_variable_name, value) self end