
- Re-factor - Remove code for notifications - Remove addons - Remove travis-core gem. - Ignore logs directory only - Move core tests to spec/lib
23 lines
465 B
Ruby
23 lines
465 B
Ruby
class Account
|
|
class << self
|
|
def from(record, attrs = {})
|
|
new(record.attributes.merge(:type => record.class.name).merge(attrs))
|
|
end
|
|
end
|
|
|
|
ATTR_NAMES = [:id, :type, :name, :login, :repos_count, :avatar_url]
|
|
|
|
attr_accessor *ATTR_NAMES
|
|
|
|
def initialize(attrs)
|
|
attrs = attrs.symbolize_keys
|
|
ATTR_NAMES.each do |name|
|
|
self.send(:"#{name}=", attrs[name])
|
|
end
|
|
end
|
|
|
|
def ==(other)
|
|
id == other.id && type == other.type
|
|
end
|
|
end
|