mls 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/mls.rb +6 -1
- data/lib/mls/models/account.rb +6 -1
- data/lib/mls/models/listing.rb +10 -3
- data/lib/mls/parser.rb +1 -0
- data/mls.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48488e5e700d96431a1f1c963ba820bbf5e5377c
|
4
|
+
data.tar.gz: f65241be79369c26998a9a14a399c33c9874cd69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9278315dcc461af3a2bb6ab93aa8d1518723d3602d1f77b096badbad117e20712bef78359fbc52afc2af1e3d82d165f8022abec839b6a97e535e9e8d14e35cc7
|
7
|
+
data.tar.gz: 87ae8fcdc210dc41a062f368d050550a436c80ef8fedaa988d02755bc402fe7650df0b0f2395a51e104f01e4ff81a938407c6c2e5776405f1a98a47211f481cc
|
data/lib/mls.rb
CHANGED
@@ -24,7 +24,7 @@ class MLS
|
|
24
24
|
API_VERSION = '0.1.0'
|
25
25
|
|
26
26
|
attr_reader :url, :user_agent
|
27
|
-
attr_writer :asset_host, :image_host, :listing_amenities, :address_amenities
|
27
|
+
attr_writer :asset_host, :image_host, :agent_profile, :listing_amenities, :address_amenities
|
28
28
|
attr_accessor :api_key, :auth_key, :logger
|
29
29
|
|
30
30
|
# Sets the API Token and Host of the MLS Server
|
@@ -72,6 +72,11 @@ class MLS
|
|
72
72
|
.parse(MLS.get('/listings/amenities').body)
|
73
73
|
end
|
74
74
|
|
75
|
+
def agent_profile(id)
|
76
|
+
@agent_profile = Yajl::Parser.new(:symbolize_keys => true)
|
77
|
+
.parse(MLS.get("/agents/#{id}").body)
|
78
|
+
end
|
79
|
+
|
75
80
|
def address_amenities
|
76
81
|
@address_amenities ||= Yajl::Parser.new(:symbolize_keys => true)
|
77
82
|
.parse(MLS.get('/addresses/amenities').body)
|
data/lib/mls/models/account.rb
CHANGED
@@ -26,6 +26,7 @@ class MLS::Account < MLS::Resource
|
|
26
26
|
property :created_at, DateTime, :serialize => :false
|
27
27
|
property :updated_at, DateTime, :serialize => :false
|
28
28
|
|
29
|
+
property :email_token, String, :serialize => false
|
29
30
|
property :auth_key, String, :serialize => false
|
30
31
|
|
31
32
|
exclude_from_comparison :password, :password_confirmation
|
@@ -66,7 +67,11 @@ class MLS::Account < MLS::Resource
|
|
66
67
|
response = MLS.get('/account/favorites')
|
67
68
|
@favorites = MLS::Listing::Parser.parse_collection(response.body, {:collection_root_element => :favorites})
|
68
69
|
end
|
69
|
-
|
70
|
+
|
71
|
+
def agent_profile
|
72
|
+
@agent_profile ||= MLS.agent_profile id
|
73
|
+
end
|
74
|
+
|
70
75
|
def favorited?(listing)
|
71
76
|
favorites.include?(listing)
|
72
77
|
end
|
data/lib/mls/models/listing.rb
CHANGED
@@ -35,6 +35,8 @@ class MLS::Listing < MLS::Resource
|
|
35
35
|
property :lease_terms, String
|
36
36
|
property :rate, Decimal
|
37
37
|
property :rate_units, String, :default => '/sqft/mo'
|
38
|
+
property :low_rate, Decimal, :serialize => :false
|
39
|
+
property :high_rate, Decimal, :serialize => :false
|
38
40
|
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
|
39
41
|
property :rate_per_sqft_per_year, Decimal, :serialize => :false
|
40
42
|
property :rate_per_month, Decimal, :serialize => :false
|
@@ -65,9 +67,14 @@ class MLS::Listing < MLS::Resource
|
|
65
67
|
|
66
68
|
property :created_at, DateTime, :serialize => :false
|
67
69
|
property :updated_at, DateTime, :serialize => :false
|
68
|
-
property :touched_at,
|
70
|
+
property :touched_at, DateTime, :serialize => :false
|
69
71
|
property :leased_on, DateTime
|
70
|
-
|
72
|
+
property :photography_requested_on, DateTime, :serialize => :false
|
73
|
+
|
74
|
+
property :awesome_score, Fixnum
|
75
|
+
property :awesome_needs, Array, :serialize => :if_present
|
76
|
+
property :awesome_label, String
|
77
|
+
|
71
78
|
property :flyer_id, Fixnum, :serialize => :if_present
|
72
79
|
property :floorplan_id, Fixnum, :serialize => :if_present
|
73
80
|
|
@@ -154,7 +161,7 @@ class MLS::Listing < MLS::Resource
|
|
154
161
|
MLS::Tour.create(id, account, tour)
|
155
162
|
end
|
156
163
|
|
157
|
-
|
164
|
+
|
158
165
|
def create
|
159
166
|
MLS.post('/listings', {:listing => to_hash}, 201, 400) do |response, code|
|
160
167
|
raise MLS::Exception::UnexpectedResponse if ![201, 400].include?(code)
|
data/lib/mls/parser.rb
CHANGED
data/mls.gemspec
CHANGED
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.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James R. Bracy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|