class Unparser::Anima::Attribute

An attribute

def get(object)

Returns:
  • (Object) -

Parameters:
  • object (Object) --
def get(object)
  object.public_send(name)
end

def initialize(name)

Parameters:
  • name (Symbol) --
def initialize(name)
  @name = name
  @instance_variable_name = :"@#{name}"
end

def load(object, attributes)

Returns:
  • (self) -

Parameters:
  • attributes (Hash) --
  • object (Object) --
def load(object, attributes)
  set(object, attributes.fetch(name))
end

def set(object, value)

Returns:
  • (self) -

Parameters:
  • value (Object) --
  • object (Object) --
def set(object, value)
  object.instance_variable_set(instance_variable_name, value)
  self
end