google_maps_geocoder 1.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d45704cd9fecd59b00591bd561fa45f930bed4b9376839c322228b61f68921de
4
- data.tar.gz: 8a99a157e60fe7a5ab5cd150b4cf43f74f8a17f4c2bbd4470cfa2bdf7003885f
3
+ metadata.gz: 04d445c8366e6292e9ec6648c7481d2dc7f3552591042d700d561fced7c14173
4
+ data.tar.gz: 14653cc8574c36ee32aacb19f5134396143966f2f57baa13bb60be48c01da5eb
5
5
  SHA512:
6
- metadata.gz: 0623df2d43e6a72c86f1e185940928ed99112b0c2cdac9f49200409e502f266af0519dd09fef20120cb34f231bdb95693a07424e4e261d57166aa2256bba6fbc
7
- data.tar.gz: c2d6b26554daba5c31f48656b1393713d8df80a551974b13dd4837c9b92f3639080bd984e041f47f317f00cab97c7139b96815f4943320a759ffd532410a4a29
6
+ metadata.gz: 15e9e5ca1822fdb62de2a8092f9e7bf9929dd75531fa1de73579ffa2c9266c246f9ba04b9dbdc69c8f9cb959e473b029fd30c6de0120ef5a46c55e414cb0f9f2
7
+ data.tar.gz: 746640c71ad9e4dd518c5196d66b32236f31456e42ac010e037b477b730fa24c562f996b011b377a148c5382f4f50bb875d4b402dcebb02c86bed7e9f7b679a5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -14,7 +14,7 @@ require 'rack'
14
14
  # chez_barack.formatted_address
15
15
  # => "1600 Pennsylvania Avenue Northwest, President's Park,
16
16
  # Washington, DC 20500, USA"
17
- # rubocop:disable Metrics/ClassLength
17
+ # rubocop:disable-next Metrics/ClassLength
18
18
  class GoogleMapsGeocoder
19
19
  GOOGLE_ADDRESS_SEGMENTS = %i[
20
20
  city country_long_name country_short_name county lat lng postal_code
@@ -28,7 +28,7 @@ class GoogleMapsGeocoder
28
28
  ).freeze
29
29
  private_constant :ALL_ADDRESS_SEGMENTS
30
30
 
31
- # Returns the complete formatted address with standardized abbreviations.
31
+ # The complete formatted address with standardized abbreviations.
32
32
  #
33
33
  # @return [String] the complete formatted address
34
34
  # @example
@@ -37,36 +37,114 @@ class GoogleMapsGeocoder
37
37
  # Washington, DC 20500, USA"
38
38
  attr_reader :formatted_address
39
39
 
40
- # Returns the formatted street address with standardized abbreviations.
40
+ # The formatted street address with standardized abbreviations.
41
41
  #
42
42
  # @return [String] the formatted street address
43
43
  # @example
44
44
  # chez_barack.formatted_street_address
45
45
  # => "1600 Pennsylvania Avenue Northwest"
46
46
  attr_reader :formatted_street_address
47
- # Self-explanatory
47
+
48
+ # The address' city.
49
+ #
50
+ # @return [String] city
51
+ # @example
52
+ # chez_barack.city
53
+ # => "Washington"
54
+ # :attr_reader: city
55
+
56
+ # The address' country as a full string.
57
+ #
58
+ # @return [String] country
59
+ # @example
60
+ # chez_barack.country_long_name
61
+ # => "United States"
62
+ # :attr_reader: country_long_name
63
+
64
+ # The address' country as an abbreviated string.
65
+ #
66
+ # @return [String] country
67
+ # @example
68
+ # chez_barack.country_short_name
69
+ # => "US"
70
+ # :attr_reader: country_short_name
71
+
72
+ # The address' county.
73
+ #
74
+ # @return [String] county
75
+ # @example
76
+ # chez_barack.county
77
+ # => nil
78
+ # :attr_reader: county
79
+
80
+ # The address' latitude as a float.
81
+ #
82
+ # @return [Float] latitude
83
+ # @example
84
+ # chez_barack.lat
85
+ # => 38.8976763
86
+ # :attr_reader: lat
87
+
88
+ # The address' longitude as a float.
89
+ #
90
+ # @return [Float] longitude
91
+ # @example
92
+ # chez_barack.lng
93
+ # => -77.0365298
94
+ # :attr_reader: lng
95
+
96
+ # The address' postal code.
97
+ #
98
+ # @return [String] postal code
99
+ # @example
100
+ # chez_barack.postal_code
101
+ # => "20500"
102
+ # :attr_reader: postal_code
103
+
104
+ # The address' state as a full string.
105
+ #
106
+ # @return [String] state
107
+ # @example
108
+ # chez_barack.state_long_name
109
+ # => "District of Columbia"
110
+ # :attr_reader: state_long_name
111
+
112
+ # The address' state as an abbreviated string.
113
+ #
114
+ # @return [String] state
115
+ # @example
116
+ # chez_barack.state_short_name
117
+ # => "DC"
118
+ # :attr_reader: state_short_name
48
119
  attr_reader(*GOOGLE_ADDRESS_SEGMENTS)
49
120
 
50
- # Returns the formatted address as a comma-delimited string.
121
+ # The formatted address as a comma-delimited string.
122
+ # @return [String] the complete formatted address
51
123
  alias address formatted_address
52
- # Returns the address' country as a full string.
124
+ # The address' country as a full string.
125
+ # @return [String] country
53
126
  alias country country_long_name
54
- # Returns the address' country as an abbreviated string.
127
+ # The address' country as an abbreviated string.
128
+ # @return [String] country
55
129
  alias country_code country_short_name
56
- # Returns the address' latitude as a float.
130
+ # The address' latitude as a float.
131
+ # @return [Float] latitude
57
132
  alias latitude lat
58
- # Returns the address' longitude as a float.
133
+ # The address' longitude as a float.
134
+ # @return [Float] longitude
59
135
  alias longitude lng
60
- # Returns the address' state as a full string.
136
+ # The address' state as a full string.
137
+ # @return [String] state
61
138
  alias state state_long_name
62
- # Returns the address' state as an abbreviated string.
139
+ # The address' state as an abbreviated string.
140
+ # @return [String] state
63
141
  alias state_code state_short_name
64
142
 
65
143
  # Geocodes the specified address and wraps the results in a GoogleMapsGeocoder
66
144
  # object.
67
145
  #
68
- # @param address [String] a geocodable address
69
- # @param logger [Logger] a standard Logger, defaults to standard error
146
+ # @param [String] address a geocodable address
147
+ # @param [Logger] logger a standard Logger, defaults to standard error
70
148
  # @return [GoogleMapsGeocoder] the Google Maps result for the specified
71
149
  # address
72
150
  # @example
@@ -82,6 +160,11 @@ class GoogleMapsGeocoder
82
160
  end
83
161
 
84
162
  # Returns the address' coordinates as an array of floats.
163
+ #
164
+ # @return [Array] the latitude and longitude in an array
165
+ # @example
166
+ # chez_barack.coordinates
167
+ # => [38.8975862, -77.0366871]
85
168
  def coordinates
86
169
  [lat, lng]
87
170
  end
@@ -120,8 +203,8 @@ class GoogleMapsGeocoder
120
203
 
121
204
  # Initialize a GeocodingError wrapping the JSON returned by Google Maps.
122
205
  #
123
- # @param json [Hash] Google Maps' JSON response
124
- # @param logger [Logger] a standard Logger
206
+ # @param [Hash] json Google Maps' JSON response
207
+ # @param [Logger] logger a standard Logger
125
208
  # @return [GeocodingError] the geocoding error
126
209
  def initialize(json = {}, logger:)
127
210
  @json = json
@@ -211,4 +294,3 @@ class GoogleMapsGeocoder
211
294
  end
212
295
  end
213
296
  end
214
- # rubocop:enable Metrics/ClassLength
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_maps_geocoder
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roderick Monje
@@ -9,29 +9,30 @@ bindir: bin
9
9
  cert_chain:
10
10
  - |
11
11
  -----BEGIN CERTIFICATE-----
12
- MIIENjCCAp6gAwIBAgIBAjANBgkqhkiG9w0BAQsFADBBMQwwCgYDVQQDDANyb2Qx
12
+ MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQwwCgYDVQQDDANyb2Qx
13
13
  HDAaBgoJkiaJk/IsZAEZFgxmb3ZlYWNlbnRyYWwxEzARBgoJkiaJk/IsZAEZFgNj
14
- b20wHhcNMjUwODEyMjEyNzIyWhcNMjYwODEyMjEyNzIyWjBBMQwwCgYDVQQDDANy
14
+ b20wHhcNMjYxMTE2MjIxOTEyWhcNMjcxMTE2MjIxOTEyWjBBMQwwCgYDVQQDDANy
15
15
  b2QxHDAaBgoJkiaJk/IsZAEZFgxmb3ZlYWNlbnRyYWwxEzARBgoJkiaJk/IsZAEZ
16
- FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC6asLzbFQpchSv
17
- u+05KuCzQW39QZq65t3c0kfUsIx+WREjBw2QlM6jVItYj4euRRszLwxhSMCtMsno
18
- Fhas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Ttyu79P5lnrLejGM2R+gCSsn0BjO
31
+ FNayo3a08esooigJGkYnj6XzSrK4woF05KTS7bdv9D06n18UbHxSm9ODlbro0nJh
32
+ O+oGe9KNSeBVG8P9AGQFTCfmbhWofGeshWDu2T1QWSp8h/GJBk58ej+axAzBuQ07
33
+ A+GDhqm6eISo2zIqUJ3HKj0PRu43bRyTbP/Yvq1GVTB9KeBxRRCBQW3XlIZEjqgm
34
+ N1NpxIQ9A/eQwClfvkcHJePuxXdV+pmNVggV844hZnuqBrQcCbU2VY5SxVAjzcoF
35
+ +DTht1JkNly7/9lKTGN6nE0j2X4zih6FBXUQtMiiHoR7T3PTOqgd35tXtTU=
35
36
  -----END CERTIFICATE-----
36
37
  date: 1980-01-02 00:00:00.000000000 Z
37
38
  dependencies:
@@ -76,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  requirements: []
79
- rubygems_version: 3.7.1
80
+ rubygems_version: 4.0.6
80
81
  specification_version: 4
81
82
  summary: A simple PORO wrapper for geocoding with Google Maps.
82
83
  test_files: []
metadata.gz.sig CHANGED
Binary file