2009-06-28 23:12:10 -04:00
|
|
|
class Contact
|
2010-07-21 07:00:56 -04:00
|
|
|
extend ActiveModel::Naming
|
2010-02-21 02:47:37 -05:00
|
|
|
include ActiveModel::Conversion
|
|
|
|
|
2010-02-21 05:09:21 -05:00
|
|
|
attr_accessor :id, :name, :age, :created_at, :awesome, :preferences
|
2009-07-22 22:06:34 -04:00
|
|
|
|
2010-04-29 17:39:05 -04:00
|
|
|
def social
|
|
|
|
%w(twitter github)
|
|
|
|
end
|
|
|
|
|
|
|
|
def network
|
|
|
|
{:git => :github}
|
|
|
|
end
|
|
|
|
|
2009-07-22 22:06:34 -04:00
|
|
|
def initialize(options = {})
|
|
|
|
options.each { |name, value| send("#{name}=", value) }
|
|
|
|
end
|
2010-02-21 02:47:37 -05:00
|
|
|
|
2010-02-21 05:09:21 -05:00
|
|
|
def persisted?
|
2010-02-22 02:45:41 -05:00
|
|
|
id
|
2010-02-21 02:47:37 -05:00
|
|
|
end
|
2009-06-28 23:12:10 -04:00
|
|
|
end
|