Permalink
Browse files

Changes to allow tour requests to be claimed.

  • Loading branch information...
dana11235 committed Jan 9, 2013
1 parent 7d23f7c commit e2ab4f8872f67995aa5f19a18f0f854073ea339c
Showing with 20 additions and 1 deletion.
  1. +5 −0 lib/mls/models/account.rb
  2. +15 −1 lib/mls/models/tour_request.rb
@@ -145,6 +145,11 @@ def search(terms)
MLS::Account::Parser.parse_collection(response.body)
end
+ def find(id)
+ response = MLS.get("/account/find", :id => id)
+ MLS::Account::Parser.parse(response.body)
+ end
+
end
end
@@ -13,12 +13,26 @@ class MLS::TourRequest < MLS::Resource
attr_accessor :account, :listing
+ def claim(agent)
+ MLS.post("/tour_requests/#{id}/claim", {:agent_id => agent.id}) do |response, code|
+ if code == 200
+ true
+ else
+ false
+ end
+ end
+ end
+
class << self
def get_all_for_account
response = MLS.get('/account/tour_requests')
MLS::TourRequest::Parser.parse_collection(response.body)
end
+ def find(id)
+ response = MLS.get("/tour_requests/#{id}")
+ MLS::TourRequest::Parser.parse(response.body)
+ end
end
end
@@ -31,4 +45,4 @@ def listing=(listing)
def account=(account)
@object.account = MLS::Account::Parser.build(account)
end
-end
+end

0 comments on commit e2ab4f8

Please sign in to comment.