Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added agent info method to accounts

  • Loading branch information...
commit b067e7c7173d3965235c9fbcffb2fed8a245fc8b 1 parent 4d46898
Roger Cosseboom rcbm authored
Showing with 11 additions and 4 deletions.
  1. +5 −0 lib/mls.rb
  2. +5 −3 lib/mls/models/account.rb
  3. +1 −1  mls.gemspec
5 lib/mls.rb
View
@@ -72,6 +72,11 @@ def listing_amenities
.parse(MLS.get('/listings/amenities').body)
end
+ def agent_info(id)
+ @agent_info ||= Yajl::Parser.new(:symbolize_keys => true)
+ .parse(MLS.get("/agents/#{id}").body)
+ end
+
def address_amenities
@address_amenities ||= Yajl::Parser.new(:symbolize_keys => true)
.parse(MLS.get('/addresses/amenities').body)
8 lib/mls/models/account.rb
View
@@ -26,8 +26,6 @@ class MLS::Account < MLS::Resource
property :created_at, DateTime, :serialize => :false
property :updated_at, DateTime, :serialize => :false
- property :listing_needs_counts, Hash, :serialize => :if_present
-
property :auth_key, String, :serialize => false
exclude_from_comparison :password, :password_confirmation
@@ -68,7 +66,11 @@ def favorites
response = MLS.get('/account/favorites')
@favorites = MLS::Listing::Parser.parse_collection(response.body, {:collection_root_element => :favorites})
end
-
+
+ def agent_info
+ MLS.agent_info id
+ end
+
def favorited?(listing)
favorites.include?(listing)
end
2  mls.gemspec
View
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "mls"
- s.version = '0.5.2'
+ s.version = '0.5.3'
s.authors = ["James R. Bracy", "Jon Bracy"]
s.email = ["james@42floors.com"]
s.homepage = "http://mls.42floors.com"
Please sign in to comment.
Something went wrong with that request. Please try again.