mls 0.2.41 → 0.2.42
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mls/models/address.rb +1 -3
- data/lib/mls/models/listing.rb +10 -3
- data/mls.gemspec +1 -1
- metadata +3 -3
data/lib/mls/models/address.rb
CHANGED
@@ -154,9 +154,7 @@ class MLS::Address::Parser < MLS::Parser
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def photos=(photos)
|
157
|
-
@object.photos = photos.map
|
158
|
-
MLS::Photo.new(:digest => p[:digest], :id => p[:id].to_i)
|
159
|
-
end
|
157
|
+
@object.photos = photos.map {|p| MLS::Photo::Parser.build(p)}
|
160
158
|
end
|
161
159
|
|
162
160
|
def videos=(videos)
|
data/lib/mls/models/listing.rb
CHANGED
@@ -67,6 +67,10 @@ class MLS::Listing < MLS::Resource
|
|
67
67
|
property :floorplan_id, Fixnum, :serialize => :if_present
|
68
68
|
|
69
69
|
property :avatar_digest, String, :serialize => false
|
70
|
+
|
71
|
+
# Counter Caches
|
72
|
+
property :photos_count Fixnum, :serialize => :false
|
73
|
+
|
70
74
|
attr_accessor :address, :agents, :account, :photos, :flyer, :floorplan, :videos
|
71
75
|
attr_writer :amenities
|
72
76
|
|
@@ -214,6 +218,11 @@ class MLS::Listing < MLS::Resource
|
|
214
218
|
MLS.listing_amenities
|
215
219
|
end
|
216
220
|
|
221
|
+
def similar
|
222
|
+
response = MLS.get("/listings/#{self.id}/similar") # TODO: Number of listings?
|
223
|
+
MLS::Listing::Parser.parse_collection(response.body)
|
224
|
+
end
|
225
|
+
|
217
226
|
class << self
|
218
227
|
|
219
228
|
def find(id)
|
@@ -245,9 +254,7 @@ end
|
|
245
254
|
class MLS::Listing::Parser < MLS::Parser
|
246
255
|
|
247
256
|
def photos=(photos)
|
248
|
-
@object.photos = photos.map
|
249
|
-
MLS::Photo.new(:digest => p[:digest], :id => p[:id].to_i)
|
250
|
-
end
|
257
|
+
@object.photos = photos.map {|p| MLS::Photo::Parser.build(p)}
|
251
258
|
end
|
252
259
|
|
253
260
|
def videos=(videos)
|
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.2.
|
4
|
+
version: 0.2.42
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -283,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
283
|
version: '0'
|
284
284
|
requirements: []
|
285
285
|
rubyforge_project: mls
|
286
|
-
rubygems_version: 1.8.
|
286
|
+
rubygems_version: 1.8.23
|
287
287
|
signing_key:
|
288
288
|
specification_version: 3
|
289
289
|
summary: 42Floors MLS Client
|