mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
eebb9ddf9b
I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
26 lines
397 B
Ruby
26 lines
397 B
Ruby
class Contact
|
|
extend ActiveModel::Naming
|
|
include ActiveModel::Conversion
|
|
|
|
attr_accessor :id, :name, :age, :created_at, :awesome, :preferences
|
|
|
|
def social
|
|
%w(twitter github)
|
|
end
|
|
|
|
def network
|
|
{ git: :github }
|
|
end
|
|
|
|
def initialize(options = {})
|
|
options.each { |name, value| send("#{name}=", value) }
|
|
end
|
|
|
|
def pseudonyms
|
|
nil
|
|
end
|
|
|
|
def persisted?
|
|
id
|
|
end
|
|
end
|