tops_connect 0.6.2 → 0.6.3

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
  SHA256:
3
- metadata.gz: 19eacdbadcf98b8c05f8e247531d434434ca550fe6df8d0933bae3b163908fae
4
- data.tar.gz: 3c65b8e8e9b793da4c09e2236af78cd48ffd66079db0a67c5a286cd8a5c1811d
3
+ metadata.gz: c1da159c957169c864437ed7a8125f908903a22f529618e5ac44ea113eabe7a4
4
+ data.tar.gz: e4c412f6145319bb92afe3347fbcaa9e96c30e7d0bb1436ca3602bfa20a7f846
5
5
  SHA512:
6
- metadata.gz: 92de859fe30ee313d23b6e2fdd7747dc0a0d718b3612f9e0bd376199a2081b9bedda3862c683176841edcbe17b8908bd602eccb2909ed19b14ec1bee393efa86
7
- data.tar.gz: 95a110b1d5715f85f8fb900ab014ece9aa56556779c96890dab5ea0096714d82d09752e1a2ee83efebfbccc921be9dbafe8a99c5ebd88872e12398075ab8a6d1
6
+ metadata.gz: e68a54baaeb1e084cc883432a344faf46a3563234365319c0462cf9e01b51a5035a029869af8d8f30534acc730133b32da627879695302188b74f9c8d5baf56c
7
+ data.tar.gz: e6712c7f64c7c30d529e5436e08fdac9a39c051339268b7df679757c29083fbf183607ad89bdd978462a5df7394efae2a311bf7d0f7684d7681fc3da70c8002a
@@ -12,13 +12,10 @@ module TopsConnect
12
12
  end
13
13
 
14
14
  def address
15
- lines = [
16
- property['AddressLine1'],
17
- property['AddressLine2'],
18
- city_state_zip
19
- ]
20
-
21
- lines.map(&:strip).select { |line| line.match?(/[[:graph:]]/) }.join("\n")
15
+ [*address_lines_with_unit_number, city_state_zip]
16
+ .map(&:strip)
17
+ .select { |line| line.match?(/[[:graph:]]/) }
18
+ .join("\n")
22
19
  end
23
20
 
24
21
  def community_key
@@ -42,5 +39,17 @@ module TopsConnect
42
39
  @property ||= data['Addresses']
43
40
  .find { |row| row.dig('Type', 'Name') == 'Property' }
44
41
  end
42
+
43
+ # Sometimes the unit number is alone on the second line
44
+ def address_lines_with_unit_number
45
+ if property['AddressLine2'].match?(/\A\d+\z/)
46
+ return ["#{property['AddressLine1']} ##{property['AddressLine2']}"]
47
+ end
48
+
49
+ [
50
+ property['AddressLine1'],
51
+ property['AddressLine2']
52
+ ]
53
+ end
45
54
  end
46
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TopsConnect
4
- VERSION = '0.6.2'
4
+ VERSION = '0.6.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tops_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hoffman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler