mls 0.5.10 → 0.5.11
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/lib/mls.rb +1 -11
- data/lib/mls/models/address.rb +5 -5
- data/lib/mls/models/listing.rb +6 -7
- data/lib/mls/models/region.rb +1 -1
- data/lib/mls/properties/hash.rb +1 -1
- 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: 01ef30970a9913172f3c8d3e90fbb58a49be6d88
|
4
|
+
data.tar.gz: 4dfce25762c45e70d0541053d08faa26ee09279a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ecf55cba4258e3286a31637ec088c1f274ccf72cd0bc2cb65a3fc151759294fb42e22778d987259a84507e968231852c3f0aa756fb769e0a7c9dfaeb13434c
|
7
|
+
data.tar.gz: ed3c79badd55feafe2ca75158f95ef3063903275cd1516a0b86d5cb625e6bc521eefd38191c7a088aeb53ffd563c425328a3d7dd2a19acf8b33ffd4c4b893a21
|
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, :agent_profile
|
27
|
+
attr_writer :asset_host, :image_host, :agent_profile
|
28
28
|
attr_accessor :api_key, :auth_key, :logger
|
29
29
|
|
30
30
|
# Sets the API Token and Host of the MLS Server
|
@@ -67,21 +67,11 @@ class MLS
|
|
67
67
|
@image_host ||= get('/image_host').body
|
68
68
|
end
|
69
69
|
|
70
|
-
def listing_amenities
|
71
|
-
@listing_amenities ||= Yajl::Parser.new(:symbolize_keys => true)
|
72
|
-
.parse(MLS.get('/listings/amenities').body)
|
73
|
-
end
|
74
|
-
|
75
70
|
def agent_profile(id)
|
76
71
|
@agent_profile = Yajl::Parser.new(:symbolize_keys => true)
|
77
72
|
.parse(MLS.get("/agents/#{id}").body)
|
78
73
|
end
|
79
74
|
|
80
|
-
def address_amenities
|
81
|
-
@address_amenities ||= Yajl::Parser.new(:symbolize_keys => true)
|
82
|
-
.parse(MLS.get('/addresses/amenities').body)
|
83
|
-
end
|
84
|
-
|
85
75
|
def headers # TODO: testme
|
86
76
|
h = {
|
87
77
|
'Content-Type' => 'application/json',
|
data/lib/mls/models/address.rb
CHANGED
@@ -108,10 +108,6 @@ class MLS::Address < MLS::Resource
|
|
108
108
|
"http://#{host}/#{slug}"
|
109
109
|
end
|
110
110
|
|
111
|
-
def amenities
|
112
|
-
MLS.address_amenities
|
113
|
-
end
|
114
|
-
|
115
111
|
def find_listings(space_available, floor, unit)
|
116
112
|
response = MLS.get("/addresses/#{id}/find_listings",
|
117
113
|
:floor => floor, :unit => unit, :space_available => space_available)
|
@@ -135,7 +131,11 @@ class MLS::Address < MLS::Resource
|
|
135
131
|
response = MLS.get('/addresses', options)
|
136
132
|
MLS::Address::Parser.parse_collection(response.body)
|
137
133
|
end
|
138
|
-
|
134
|
+
|
135
|
+
def amenities
|
136
|
+
@amenities ||= Yajl::Parser.new(:symbolize_keys => true).parse(MLS.get('/addresses/amenities').body)
|
137
|
+
end
|
138
|
+
|
139
139
|
end
|
140
140
|
|
141
141
|
end
|
data/lib/mls/models/listing.rb
CHANGED
@@ -32,7 +32,8 @@ class MLS::Listing < MLS::Resource
|
|
32
32
|
property :size, Fixnum
|
33
33
|
property :maximum_contiguous_size, Fixnum
|
34
34
|
property :minimum_divisible_size, Fixnum
|
35
|
-
|
35
|
+
|
36
|
+
property :amenities, Hash
|
36
37
|
property :lease_terms, String
|
37
38
|
property :rate, Decimal
|
38
39
|
property :rate_units, String, :default => '/sqft/mo'
|
@@ -85,7 +86,6 @@ class MLS::Listing < MLS::Resource
|
|
85
86
|
property :photos_count, Fixnum, :serialize => :false
|
86
87
|
|
87
88
|
attr_accessor :address, :agents, :account, :photos, :flyer, :floorplan, :videos
|
88
|
-
attr_writer :amenities
|
89
89
|
|
90
90
|
def avatar(size='150x100#', protocol='http')
|
91
91
|
if avatar_digest
|
@@ -227,11 +227,6 @@ class MLS::Listing < MLS::Resource
|
|
227
227
|
videos + address.videos
|
228
228
|
end
|
229
229
|
|
230
|
-
# TODO: Remove / What does this function do?
|
231
|
-
def amenities
|
232
|
-
MLS.listing_amenities
|
233
|
-
end
|
234
|
-
|
235
230
|
def similar
|
236
231
|
[] # Similar Listings not supported for now
|
237
232
|
end
|
@@ -259,6 +254,10 @@ class MLS::Listing < MLS::Resource
|
|
259
254
|
MLS::Parser.extract_attributes(response.body)[:listings]
|
260
255
|
end
|
261
256
|
|
257
|
+
def amenities
|
258
|
+
@amenities ||= Yajl::Parser.new(:symbolize_keys => true).parse(MLS.get('/listings/amenities').body)
|
259
|
+
end
|
260
|
+
|
262
261
|
end
|
263
262
|
|
264
263
|
end
|
data/lib/mls/models/region.rb
CHANGED
@@ -2,7 +2,7 @@ class MLS::Region < MLS::Resource
|
|
2
2
|
|
3
3
|
property :id, Fixnum, :serialize => :if_present
|
4
4
|
property :name, String, :serialize => false
|
5
|
-
property :proper_name
|
5
|
+
property :proper_name, String, :serialize => :if_present
|
6
6
|
property :common_name, String, :serialize => :if_present
|
7
7
|
property :description, String, :serialize => :if_present
|
8
8
|
property :code, String, :serialize => :if_present
|
data/lib/mls/properties/hash.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.11
|
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-07-
|
12
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|