mls 0.2.17 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -145,6 +145,11 @@ class MLS::Account < MLS::Resource
145
145
  MLS::Account::Parser.parse_collection(response.body)
146
146
  end
147
147
 
148
+ def find(id)
149
+ response = MLS.get("/account/find", :id => id)
150
+ MLS::Account::Parser.parse(response.body)
151
+ end
152
+
148
153
  end
149
154
 
150
155
  end
@@ -16,8 +16,8 @@ class MLS::Address < MLS::Resource
16
16
  property :state, String
17
17
  property :country, String
18
18
  property :postal_code, String
19
- property :min_rate_per_year, Decimal, :serialize => :if_present
20
- property :max_rate_per_year, Decimal, :serialize => :if_present
19
+ property :min_rate_per_sqft_per_year, Decimal, :serialize => :if_present
20
+ property :max_rate_per_sqft_per_year, Decimal, :serialize => :if_present
21
21
  property :max_size, Fixnum, :serialize => :if_present
22
22
  property :min_size, Fixnum, :serialize => :if_present
23
23
  property :comments, String
@@ -34,10 +34,10 @@ class MLS::Listing < MLS::Resource
34
34
  property :lease_terms, String
35
35
  property :rate, Decimal
36
36
  property :rate_units, String, :default => '/sqft/mo'
37
- property :rate_per_month, Decimal, :serialize => :false # need to make write methods for these that set rate to the according rate units. not accepted on api
38
- property :rate_per_year, Decimal, :serialize => :false
39
- property :total_rate_per_month, Decimal, :serialize => :false
40
- property :total_rate_per_year, Decimal, :serialize => :false
37
+ property :rate_per_sqft_per_month, Decimal, :serialize => :false # need to make write methods for these that set rate to the according rate units. not accepted on api
38
+ property :rate_per_sqft_per_year, Decimal, :serialize => :false
39
+ property :monthly_rate, Decimal, :serialize => :false
40
+ property :yearly_rate, Decimal, :serialize => :false
41
41
  property :sublease_expiration, DateTime
42
42
 
43
43
  property :available_on, DateTime
@@ -13,12 +13,26 @@ class MLS::TourRequest < MLS::Resource
13
13
 
14
14
  attr_accessor :account, :listing
15
15
 
16
+ def claim(agent)
17
+ MLS.post("/tour_requests/#{id}/claim", {:agent_id => agent.id}) do |response, code|
18
+ if code == 200
19
+ true
20
+ else
21
+ false
22
+ end
23
+ end
24
+ end
25
+
16
26
  class << self
17
27
  def get_all_for_account
18
28
  response = MLS.get('/account/tour_requests')
19
29
  MLS::TourRequest::Parser.parse_collection(response.body)
20
30
  end
21
31
 
32
+ def find(id)
33
+ response = MLS.get("/tour_requests/#{id}")
34
+ MLS::TourRequest::Parser.parse(response.body)
35
+ end
22
36
  end
23
37
  end
24
38
 
@@ -31,4 +45,4 @@ class MLS::TourRequest::Parser < MLS::Parser
31
45
  def account=(account)
32
46
  @object.account = MLS::Account::Parser.build(account)
33
47
  end
34
- end
48
+ end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mls"
6
- s.version = '0.2.17'
6
+ s.version = '0.2.18'
7
7
  s.authors = ["James R. Bracy"]
8
8
  s.email = ["james@42floors.com"]
9
9
  s.homepage = "http://mls.42floors.com"
@@ -22,8 +22,8 @@ class TestListing < ::Test::Unit::TestCase
22
22
  assert listing.respond_to?(:lease_terms)
23
23
  assert listing.respond_to?(:rate)
24
24
  assert listing.respond_to?(:rate_units)
25
- assert listing.respond_to?(:rate_per_month)
26
- assert listing.respond_to?(:rate_per_year)
25
+ assert listing.respond_to?(:rate_per_sqft_per_month)
26
+ assert listing.respond_to?(:rate_per_sqft_per_year)
27
27
  assert listing.respond_to?(:sublease_expiration)
28
28
  assert listing.respond_to?(:available_on)
29
29
  assert listing.respond_to?(:maximum_term_length)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  version: '0'
282
282
  requirements: []
283
283
  rubyforge_project: mls
284
- rubygems_version: 1.8.24
284
+ rubygems_version: 1.8.23
285
285
  signing_key:
286
286
  specification_version: 3
287
287
  summary: 42Floors MLS Client