Method: Iugu::Object#set_attributes

Defined in:
lib/iugu/object.rb

#set_attributes(attributes, unsaved = false) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/iugu/object.rb', line 48

def set_attributes(attributes, unsaved = false)
  @attributes = Iugu::Utils.stringify_keys(attributes)
  @attributes.each do |k, _v|
    add_accessor(k)
  end
  @unsaved_attributes = @attributes.keys.to_set if unsaved
end