nsastorage 1.0.1 → 1.0.2

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: 0f13e7fb615668101d5da8a5549bb85779e59499c55d6935e9d4fd2f369a1b74
4
- data.tar.gz: c2aa0859eea895d690d3e24ea7de9a2f7673be7de4fe842f31f1f81c39c702c1
3
+ metadata.gz: 89b754ea451addb5ab00d398e0ade84be07ff22ae812c53f5abad7f02feac2d0
4
+ data.tar.gz: 70960c72724ced477f7505d91175c4efe7bebf7133446d65451908f08b58e051
5
5
  SHA512:
6
- metadata.gz: 2725593f7e064e70ea041f0f031cf1a2be8e7d0f024b09e14384821391748d86d6efcf081b0d89817405c89e2d253b2da0a045f0664209c19b0bd033de05c2b4
7
- data.tar.gz: 2399ae9154b3a1ac1d8af45d3aae39425f67a060aed5679e47d57d821022525539ce4b1c79e2e8e5843d3202fc9e0cea2c11febe67d16e06a41f52eb4a882079
6
+ metadata.gz: 8b6e382a1081fe2e90e576f0138cbf2c13fb6d24048ac1b9a1c3ff7bf20f9366d96b47bfd069f3d1c3f304da1d25716f9ce8a3d4a0b8d0271b0e8ee026c37bb0
7
+ data.tar.gz: b98fc06b0cab39ca5e45a216eac943685314646f4b9186929f2ee1f89366777f0c53588bc564b07c773f2b895b7c70e8e2664f756128dd2d98a145cae2bce850
@@ -37,7 +37,7 @@ module NSAStorage
37
37
  attr_accessor :address
38
38
 
39
39
  # @attribute [rw] geocode
40
- # @return [Geocode]
40
+ # @return [Geocode, nil]
41
41
  attr_accessor :geocode
42
42
 
43
43
  # @attribute [rw] prices
@@ -18,8 +18,10 @@ module NSAStorage
18
18
  #
19
19
  # @return [Geocode]
20
20
  def self.parse(document:)
21
- latitude = LATITUDE_REGEX.match(document.text)[:latitude]
22
- longitude = LONGITUDE_REGEX.match(document.text)[:longitude]
21
+ latitude = LATITUDE_REGEX.match(document.text)&.[](:latitude)
22
+ longitude = LONGITUDE_REGEX.match(document.text)&.[](:longitude)
23
+
24
+ return if latitude.nil? || longitude.nil?
23
25
 
24
26
  new(latitude: Float(latitude), longitude: Float(longitude))
25
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NSAStorage
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsastorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre