mls 0.2.33 → 0.2.34
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mls/models/address.rb +3 -1
- data/lib/mls/models/listing.rb +3 -1
- data/lib/mls/parser.rb +8 -3
- data/mls.gemspec +1 -1
- metadata +2 -2
data/lib/mls/models/address.rb
CHANGED
@@ -153,7 +153,9 @@ class MLS::Address::Parser < MLS::Parser
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def photos=(photos)
|
156
|
-
@object.photos = photos.map
|
156
|
+
@object.photos = photos.map do |p|
|
157
|
+
MLS::Photo.new(:digest => p[:digest], :id => p[:id].to_i)
|
158
|
+
end
|
157
159
|
end
|
158
160
|
|
159
161
|
def videos=(videos)
|
data/lib/mls/models/listing.rb
CHANGED
@@ -244,7 +244,9 @@ end
|
|
244
244
|
class MLS::Listing::Parser < MLS::Parser
|
245
245
|
|
246
246
|
def photos=(photos)
|
247
|
-
@object.photos = photos.map
|
247
|
+
@object.photos = photos.map do |p|
|
248
|
+
MLS::Photo.new(:digest => p[:digest], :id => p[:id].to_i)
|
249
|
+
end
|
248
250
|
end
|
249
251
|
|
250
252
|
def videos=(videos)
|
data/lib/mls/parser.rb
CHANGED
@@ -24,16 +24,21 @@ class MLS::Parser
|
|
24
24
|
def self.parse(data)
|
25
25
|
self.new.parse(data)
|
26
26
|
end
|
27
|
-
|
28
|
-
|
27
|
+
|
28
|
+
# TODO: TEST ME
|
29
|
+
def self.build_collection(hash, options={})
|
29
30
|
root = options[:collection_root_element] || collection_root_element
|
30
31
|
collection = []
|
31
|
-
|
32
|
+
data[root].each do |attrs|
|
32
33
|
collection << build(attrs)
|
33
34
|
end
|
34
35
|
collection
|
35
36
|
end
|
36
37
|
|
38
|
+
def self.parse_collection(data, options={})
|
39
|
+
build_collection(extract_attributes(data))
|
40
|
+
end
|
41
|
+
|
37
42
|
def self.build(attributes)
|
38
43
|
self.new.build(attributes)
|
39
44
|
end
|
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.34
|
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-02-
|
13
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|