eaternet 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a90f995b06ed13d80581580cf7e3c2a4cc82264f
4
- data.tar.gz: c797ce791fd07fe381a0de8c7c85e0d449b48fb8
3
+ metadata.gz: 6eb3f1b95324d324a96a86b17b3443c2a63faf7f
4
+ data.tar.gz: d632f2ab776c0b300585aeed643a62ad409e3fda
5
5
  SHA512:
6
- metadata.gz: c882a43aeaca5fc990ebc0a2f7c0414cf295db053b715307aeabbfcb84b6224d024aa411b448fed558ec2796e2a52876b6baea87624362fad1cd49375361afd2
7
- data.tar.gz: 093cdf2ec98b5a6dcae3d781fd25138802fd5e6d93d80dd17ab3fc5102fd1acd8f5a76f906009d5782a26f1db7b212b707d2213c50a4c4763e0b9edb4a7f5017
6
+ metadata.gz: 540884ffeac6ea7565996b267098cf5ceaf9ad1c4598ed37032ed97183a6e813376bb19bd6c279db3d78b4567f4c170530fc86a76f2a85fa15a506aea2548e87
7
+ data.tar.gz: 2ed55163141bcabeffc106ac400a4873257a50e193fb692809068bf5957de7cd1e45595a250a12e8c0f7840b6f7a6f4601be34c0e309375a2c6d6b20ef9896bf
@@ -13,16 +13,27 @@ module Eaternet
13
13
 
14
14
  def businesses
15
15
  @prototype.businesses
16
- .map { |proto|
17
- Business.new do |b|
18
- b.business_id = proto.orig_key
19
- b.name = proto.name
20
- b.address = proto.address
21
- b.city = proto.city
22
- b.postal_code = proto.zipcode
23
- b.state = 'NV'
24
- end
25
- }
16
+ .map { |proto| try_to_create_business(proto) }
17
+ end
18
+
19
+ def try_to_create_business(proto)
20
+ business(proto)
21
+ rescue ArgumentError => e
22
+ logger.warn('SNHD LIVES adapter') do
23
+ "Could not create a LIVES Business from #{proto.inspect}: #{e}"
24
+ end
25
+ nil
26
+ end
27
+
28
+ def business(proto)
29
+ Business.new do |b|
30
+ b.business_id = proto.orig_key
31
+ b.name = proto.name
32
+ b.address = proto.address
33
+ b.city = proto.city
34
+ b.postal_code = proto.zipcode
35
+ b.state = 'NV'
36
+ end
26
37
  end
27
38
 
28
39
  def inspections
@@ -1,3 +1,3 @@
1
1
  module Eaternet
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eaternet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter