lib/mls/models/brokerage.rb in mls-0.13.0 vs lib/mls/models/brokerage.rb in mls-0.14.0

- old
+ new

@@ -1,21 +1,16 @@ class MLS::Brokerage < MLS::Resource + attr_accessor :avatar + attribute :id, Fixnum, :serialize => :if_present attribute :name, String, :serialize => :if_present attribute :admin_id, Fixnum, :serialize => :if_present attribute :slug, String, :serialize => false attribute :palette, Hash, :serialize => :if_present - attribute :avatar_digest, String, :serialize => false class << self - - def avatar(format='png', protocol='http') - if avatar_digest - "#{protocol}://assets.42floors.com/photos/original/#{avatar_digest}.png" - end - end def find(id) response = MLS.get("/brokerages/#{id}") MLS::Brokerage::Parser.parse(response.body) end @@ -28,6 +23,9 @@ end end class MLS::Brokerage::Parser < MLS::Parser + def avatar=(avatar) + @object.avatar = MLS::Photo::Parser.build(avatar) + end end \ No newline at end of file