module ActiveModel::API

def initialize(attributes = {})

person.age # => "18"
person.name # => "bob"
person = Person.new(name: 'bob', age: '18')

end
attr_accessor :name, :age
include ActiveModel::API
class Person

Initializes a new model with the given +params+.
def initialize(attributes = {})
  assign_attributes(attributes) if attributes
  super()
end

def persisted?

person.persisted? # => false
person = Person.new(id: 1, name: 'bob')

end
attr_accessor :id, :name
include ActiveModel::API
class Person

Indicates if the model is persisted. Default is +false+.
def persisted?
  false
end