mls 0.2.33 → 0.2.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 {|p| MLS::Photo::Parser.build(p)}
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)
@@ -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 {|p| MLS::Photo::Parser.build(p)}
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)
@@ -24,16 +24,21 @@ class MLS::Parser
24
24
  def self.parse(data)
25
25
  self.new.parse(data)
26
26
  end
27
-
28
- def self.parse_collection(data, options={})
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
- extract_attributes(data)[root].each do |attrs|
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
@@ -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.33'
6
+ s.version = '0.2.34'
7
7
  s.authors = ["James R. Bracy", "Jon Bracy"]
8
8
  s.email = ["james@42floors.com"]
9
9
  s.homepage = "http://mls.42floors.com"
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.33
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-17 00:00:00.000000000 Z
13
+ date: 2013-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake