Method: ActiveEntity::AttributeMethods#attributes

Defined in:
lib/active_entity/attribute_methods.rb

#attributesObject

Returns a hash of all the attributes with their names as keys and the values of the attributes as values.

class Person < ActiveEntity::Base
end

person = Person.create(name: 'Francesco', age: 22)
person.attributes
# => {"id"=>3, "created_at"=>Sun, 21 Oct 2012 04:53:04, "updated_at"=>Sun, 21 Oct 2012 04:53:04, "name"=>"Francesco", "age"=>22}


218
219
220
# File 'lib/active_entity/attribute_methods.rb', line 218

def attributes
  @attributes.to_hash
end