lib/volt/models/model.rb
def assign_attribute(method_name, *args, &block)
    # Free any cached value
    free(method_name)

    self.expand!
    # Assign, without the =
    attribute_name = method_name[0..-2].to_sym

    value = args[0]
    __assign_element(attribute_name, value)

    attributes[attribute_name] = wrap_value(value, [attribute_name])
    trigger_by_attribute!('changed', attribute_name)

    # Let the persistor know something changed
    @persistor.changed(attribute_name) if @persistor
  end
# Do the assignment to a model and trigger a changed event
Do the assignment to a model and trigger a changed event
Do the assignment to a model and trigger a changed event
def assign_attribute(method_name, *args, &block)
    free(method_name)
    self.expand!
    attribute_name = method_name[0..-2].to_sym
    value = args[0]
    __assign_element(attribute_name, value)
    attributes[attribute_name] = wrap_value(value, [attribute_name])
    trigger_by_attribute!('changed', attribute_name)
    @persistor.changed(attribute_name) if @persistor
  end
def assign_attribute ( method_name , * args , & block ) free ( method_name ) self . expand! attribute_name = method_name [ 0 .. - 2 ] . to_sym value = args [ 0 ] __assign_element ( attribute_name , value ) attributes [ attribute_name ] = wrap_value ( value , [ attribute_name ] ) trigger_by_attribute! ( 'changed' , attribute_name ) @persistor . changed ( attribute_name ) if @persistor end
Do the assignment to a model and trigger a changed event
Do the assignment to a model and trigger a changed event
# Free any cached value # Assign, without the = # Let the persistor know something changed
method_name
args
block