loqate 0.6.0 → 0.7.0
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 +4 -4
- data/.yardstick.yml +96 -96
- data/CHANGELOG.md +5 -0
- data/README.md +8 -40
- data/ROADMAP.md +1 -1
- data/lib/loqate/address/address.rb +37 -0
- data/lib/loqate/address/detailed_address.rb +85 -0
- data/lib/loqate/address/gateway.rb +149 -0
- data/lib/loqate/email/batch_email_validation.rb +68 -0
- data/lib/loqate/email/email_validation.rb +83 -0
- data/lib/loqate/email/gateway.rb +124 -0
- data/lib/loqate/gateway.rb +10 -10
- data/lib/loqate/phone/gateway.rb +84 -0
- data/lib/loqate/phone/phone_number_validation.rb +69 -0
- data/lib/loqate/version.rb +1 -1
- metadata +9 -9
- data/lib/loqate/address.rb +0 -35
- data/lib/loqate/address_gateway.rb +0 -147
- data/lib/loqate/batch_email_validation.rb +0 -66
- data/lib/loqate/detailed_address.rb +0 -83
- data/lib/loqate/email_gateway.rb +0 -122
- data/lib/loqate/email_validation.rb +0 -81
- data/lib/loqate/phone_gateway.rb +0 -82
- data/lib/loqate/phone_number_validation.rb +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fb61fc51df7e0d68f444bbdc456f8dc3908f4615a34ba36aa0a16265518ea86
|
4
|
+
data.tar.gz: 53aa2a20fde0da8a1cc284f56b18dde9edbd8def3c0f3265757ec5c30f388d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be0b4b5a521533eb1f023c60c1cbd5b203fb586333dfc3a3b52bda07fe8b35a57b9d42d94a0eaf4f1a531e3f3ac2ef56917e75b1ca514dbf078c06192dc8c106
|
7
|
+
data.tar.gz: 27f8a174a784a974f755d303ff2df0f8ec370e23781b25b7dc6ad86d2bd096bd959634e4c82506971d8e14b924ad4d8fd5acb5c8c69b7ed8b6b466c94a36d295
|
data/.yardstick.yml
CHANGED
@@ -15,15 +15,15 @@ rules:
|
|
15
15
|
ExampleTag:
|
16
16
|
enabled: true
|
17
17
|
exclude:
|
18
|
-
- Loqate::Address#==
|
19
|
-
- Loqate::Address#attributes
|
20
|
-
- Loqate::Address#description
|
21
|
-
- Loqate::Address#highlight
|
22
|
-
- Loqate::Address#id
|
23
|
-
- Loqate::Address#initialize
|
24
|
-
- Loqate::Address#text
|
25
|
-
- Loqate::Address#type
|
26
|
-
- Loqate::
|
18
|
+
- Loqate::Address::Address#==
|
19
|
+
- Loqate::Address::Address#attributes
|
20
|
+
- Loqate::Address::Address#description
|
21
|
+
- Loqate::Address::Address#highlight
|
22
|
+
- Loqate::Address::Address#id
|
23
|
+
- Loqate::Address::Address#initialize
|
24
|
+
- Loqate::Address::Address#text
|
25
|
+
- Loqate::Address::Address#type
|
26
|
+
- Loqate::Address::Gateway#initialize
|
27
27
|
- Loqate::APIResult#errors?
|
28
28
|
- Loqate::APIResult#initialize
|
29
29
|
- Loqate::APIResult#items
|
@@ -83,35 +83,35 @@ rules:
|
|
83
83
|
- Loqate::Bank::Gateway#initialize
|
84
84
|
- Loqate::Bank::InternationalAccountValidation#correct?
|
85
85
|
- Loqate::Bank::InternationalAccountValidation#is_correct
|
86
|
-
- Loqate::BatchEmailValidation#account
|
87
|
-
- Loqate::BatchEmailValidation#domain
|
88
|
-
- Loqate::BatchEmailValidation#email_address
|
89
|
-
- Loqate::BatchEmailValidation#invalid?
|
90
|
-
- Loqate::BatchEmailValidation#is_disposible
|
91
|
-
- Loqate::BatchEmailValidation#is_system_mailbox
|
92
|
-
- Loqate::BatchEmailValidation#status
|
93
|
-
- Loqate::BatchEmailValidation#unknown?
|
94
|
-
- Loqate::BatchEmailValidation#unverified?
|
95
|
-
- Loqate::BatchEmailValidation#valid?
|
86
|
+
- Loqate::Email::BatchEmailValidation#account
|
87
|
+
- Loqate::Email::BatchEmailValidation#domain
|
88
|
+
- Loqate::Email::BatchEmailValidation#email_address
|
89
|
+
- Loqate::Email::BatchEmailValidation#invalid?
|
90
|
+
- Loqate::Email::BatchEmailValidation#is_disposible
|
91
|
+
- Loqate::Email::BatchEmailValidation#is_system_mailbox
|
92
|
+
- Loqate::Email::BatchEmailValidation#status
|
93
|
+
- Loqate::Email::BatchEmailValidation#unknown?
|
94
|
+
- Loqate::Email::BatchEmailValidation#unverified?
|
95
|
+
- Loqate::Email::BatchEmailValidation#valid?
|
96
96
|
- Loqate::Configuration#api_key
|
97
97
|
- Loqate::Configuration#host
|
98
98
|
- Loqate::Configuration#initialize
|
99
99
|
- Loqate::Configuration#language
|
100
|
-
- Loqate::DetailedAddress#==
|
101
|
-
- Loqate::DetailedAddress#initialize
|
102
|
-
- Loqate::
|
103
|
-
- Loqate::EmailValidation#domain
|
104
|
-
- Loqate::EmailValidation#duration
|
105
|
-
- Loqate::EmailValidation#email_address
|
106
|
-
- Loqate::EmailValidation#invalid?
|
107
|
-
- Loqate::EmailValidation#is_complainer_or_fraud_risk
|
108
|
-
- Loqate::EmailValidation#is_disposable_or_temporary
|
109
|
-
- Loqate::EmailValidation#response_code
|
110
|
-
- Loqate::EmailValidation#response_message
|
111
|
-
- Loqate::EmailValidation#timeout?
|
112
|
-
- Loqate::EmailValidation#user_account
|
113
|
-
- Loqate::EmailValidation#valid?
|
114
|
-
- Loqate::EmailValidation#valid_domain?
|
100
|
+
- Loqate::Address::DetailedAddress#==
|
101
|
+
- Loqate::Address::DetailedAddress#initialize
|
102
|
+
- Loqate::Email::Gateway#initialize
|
103
|
+
- Loqate::Email::EmailValidation#domain
|
104
|
+
- Loqate::Email::EmailValidation#duration
|
105
|
+
- Loqate::Email::EmailValidation#email_address
|
106
|
+
- Loqate::Email::EmailValidation#invalid?
|
107
|
+
- Loqate::Email::EmailValidation#is_complainer_or_fraud_risk
|
108
|
+
- Loqate::Email::EmailValidation#is_disposable_or_temporary
|
109
|
+
- Loqate::Email::EmailValidation#response_code
|
110
|
+
- Loqate::Email::EmailValidation#response_message
|
111
|
+
- Loqate::Email::EmailValidation#timeout?
|
112
|
+
- Loqate::Email::EmailValidation#user_account
|
113
|
+
- Loqate::Email::EmailValidation#valid?
|
114
|
+
- Loqate::Email::EmailValidation#valid_domain?
|
115
115
|
- Loqate::Error#cause
|
116
116
|
- Loqate::Error#description
|
117
117
|
- Loqate::Error#id
|
@@ -123,17 +123,17 @@ rules:
|
|
123
123
|
- Loqate::Gateway#email
|
124
124
|
- Loqate::Gateway#initialize
|
125
125
|
- Loqate::Gateway#phone
|
126
|
-
- Loqate::
|
127
|
-
- Loqate::PhoneNumberValidation#country_prefix
|
128
|
-
- Loqate::PhoneNumberValidation#is_valid
|
129
|
-
- Loqate::PhoneNumberValidation#national_format
|
130
|
-
- Loqate::PhoneNumberValidation#network_code
|
131
|
-
- Loqate::PhoneNumberValidation#network_country
|
132
|
-
- Loqate::PhoneNumberValidation#network_name
|
133
|
-
- Loqate::PhoneNumberValidation#number_type
|
134
|
-
- Loqate::PhoneNumberValidation#phone_number
|
135
|
-
- Loqate::PhoneNumberValidation#request_processed
|
136
|
-
- Loqate::PhoneNumberValidation#valid?
|
126
|
+
- Loqate::Phone::Gateway#initialize
|
127
|
+
- Loqate::Phone::PhoneNumberValidation#country_prefix
|
128
|
+
- Loqate::Phone::PhoneNumberValidation#is_valid
|
129
|
+
- Loqate::Phone::PhoneNumberValidation#national_format
|
130
|
+
- Loqate::Phone::PhoneNumberValidation#network_code
|
131
|
+
- Loqate::Phone::PhoneNumberValidation#network_country
|
132
|
+
- Loqate::Phone::PhoneNumberValidation#network_name
|
133
|
+
- Loqate::Phone::PhoneNumberValidation#number_type
|
134
|
+
- Loqate::Phone::PhoneNumberValidation#phone_number
|
135
|
+
- Loqate::Phone::PhoneNumberValidation#request_processed
|
136
|
+
- Loqate::Phone::PhoneNumberValidation#valid?
|
137
137
|
- Loqate::Result#code
|
138
138
|
- Loqate::Result#value
|
139
139
|
- Loqate::Result::Failure#error
|
@@ -144,19 +144,19 @@ rules:
|
|
144
144
|
ReturnTag:
|
145
145
|
enabled: true
|
146
146
|
exclude:
|
147
|
-
- Loqate::Address#==
|
148
|
-
- Loqate::Address#attributes
|
149
|
-
- Loqate::Address#description
|
150
|
-
- Loqate::Address#highlight
|
151
|
-
- Loqate::Address#id
|
152
|
-
- Loqate::Address#text
|
153
|
-
- Loqate::Address#type
|
154
|
-
- Loqate::
|
155
|
-
- Loqate::
|
156
|
-
- Loqate::
|
157
|
-
- Loqate::
|
158
|
-
- Loqate::
|
159
|
-
- Loqate::
|
147
|
+
- Loqate::Address::Address#==
|
148
|
+
- Loqate::Address::Address#attributes
|
149
|
+
- Loqate::Address::Address#description
|
150
|
+
- Loqate::Address::Address#highlight
|
151
|
+
- Loqate::Address::Address#id
|
152
|
+
- Loqate::Address::Address#text
|
153
|
+
- Loqate::Address::Address#type
|
154
|
+
- Loqate::Address::Gateway#build_addresses_from
|
155
|
+
- Loqate::Address::Gateway#build_detailed_address_from
|
156
|
+
- Loqate::Address::Gateway#build_error_from
|
157
|
+
- Loqate::Address::Gateway#client
|
158
|
+
- Loqate::Address::Gateway#error_mapper
|
159
|
+
- Loqate::Address::Gateway#mapper
|
160
160
|
- Loqate::Bank::Gateway#build_account_validation_from
|
161
161
|
- Loqate::Bank::Gateway#build_account_validations_from
|
162
162
|
- Loqate::Bank::Gateway#build_branch_from
|
@@ -170,20 +170,20 @@ rules:
|
|
170
170
|
- Loqate::Client#configuration
|
171
171
|
- Loqate::Client#format_params
|
172
172
|
- Loqate::Client#headers
|
173
|
-
- Loqate::DetailedAddress#==
|
174
|
-
- Loqate::
|
175
|
-
- Loqate::
|
176
|
-
- Loqate::
|
177
|
-
- Loqate::
|
178
|
-
- Loqate::
|
179
|
-
- Loqate::
|
173
|
+
- Loqate::Address::DetailedAddress#==
|
174
|
+
- Loqate::Email::Gateway#build_email_validation_from
|
175
|
+
- Loqate::Email::Gateway#build_email_validations_from
|
176
|
+
- Loqate::Email::Gateway#build_error_from
|
177
|
+
- Loqate::Email::Gateway#client
|
178
|
+
- Loqate::Email::Gateway#error_mapper
|
179
|
+
- Loqate::Email::Gateway#mapper
|
180
180
|
- Loqate::Error#attributes
|
181
181
|
- Loqate::Gateway#client
|
182
|
-
- Loqate::
|
183
|
-
- Loqate::
|
184
|
-
- Loqate::
|
185
|
-
- Loqate::
|
186
|
-
- Loqate::
|
182
|
+
- Loqate::Phone::Gateway#build_error_from
|
183
|
+
- Loqate::Phone::Gateway#build_phone_validation_from
|
184
|
+
- Loqate::Phone::Gateway#client
|
185
|
+
- Loqate::Phone::Gateway#error_mapper
|
186
|
+
- Loqate::Phone::Gateway#mapper
|
187
187
|
- Loqate::Result::Failure#error
|
188
188
|
- Loqate::Util#camelize
|
189
189
|
- Loqate::Util#underscore
|
@@ -192,19 +192,19 @@ rules:
|
|
192
192
|
Summary::Presence:
|
193
193
|
enabled: true
|
194
194
|
exclude:
|
195
|
-
- Loqate::Address#==
|
196
|
-
- Loqate::Address#attributes
|
197
|
-
- Loqate::Address#description
|
198
|
-
- Loqate::Address#highlight
|
199
|
-
- Loqate::Address#id
|
200
|
-
- Loqate::Address#text
|
201
|
-
- Loqate::Address#type
|
202
|
-
- Loqate::
|
203
|
-
- Loqate::
|
204
|
-
- Loqate::
|
205
|
-
- Loqate::
|
206
|
-
- Loqate::
|
207
|
-
- Loqate::
|
195
|
+
- Loqate::Address::Address#==
|
196
|
+
- Loqate::Address::Address#attributes
|
197
|
+
- Loqate::Address::Address#description
|
198
|
+
- Loqate::Address::Address#highlight
|
199
|
+
- Loqate::Address::Address#id
|
200
|
+
- Loqate::Address::Address#text
|
201
|
+
- Loqate::Address::Address#type
|
202
|
+
- Loqate::Address::Gateway#build_addresses_from
|
203
|
+
- Loqate::Address::Gateway#build_detailed_address_from
|
204
|
+
- Loqate::Address::Gateway#build_error_from
|
205
|
+
- Loqate::Address::Gateway#client
|
206
|
+
- Loqate::Address::Gateway#error_mapper
|
207
|
+
- Loqate::Address::Gateway#mapper
|
208
208
|
- Loqate::Bank::Gateway#build_account_validation_from
|
209
209
|
- Loqate::Bank::Gateway#build_account_validations_from
|
210
210
|
- Loqate::Bank::Gateway#build_branch_from
|
@@ -218,21 +218,21 @@ rules:
|
|
218
218
|
- Loqate::Client#configuration
|
219
219
|
- Loqate::Client#format_params
|
220
220
|
- Loqate::Client#headers
|
221
|
-
- Loqate::DetailedAddress#==
|
222
|
-
- Loqate::DetailedAddress#initialize
|
223
|
-
- Loqate::
|
224
|
-
- Loqate::
|
225
|
-
- Loqate::
|
226
|
-
- Loqate::
|
227
|
-
- Loqate::
|
228
|
-
- Loqate::
|
221
|
+
- Loqate::Address::DetailedAddress#==
|
222
|
+
- Loqate::Address::DetailedAddress#initialize
|
223
|
+
- Loqate::Email::Gateway#build_email_validation_from
|
224
|
+
- Loqate::Email::Gateway#build_email_validations_from
|
225
|
+
- Loqate::Email::Gateway#build_error_from
|
226
|
+
- Loqate::Email::Gateway#client
|
227
|
+
- Loqate::Email::Gateway#error_mapper
|
228
|
+
- Loqate::Email::Gateway#mapper
|
229
229
|
- Loqate::Error#attributes
|
230
230
|
- Loqate::Gateway#client
|
231
|
-
- Loqate::
|
232
|
-
- Loqate::
|
233
|
-
- Loqate::
|
234
|
-
- Loqate::
|
235
|
-
- Loqate::
|
231
|
+
- Loqate::Phone::Gateway#build_error_from
|
232
|
+
- Loqate::Phone::Gateway#build_phone_validation_from
|
233
|
+
- Loqate::Phone::Gateway#client
|
234
|
+
- Loqate::Phone::Gateway#error_mapper
|
235
|
+
- Loqate::Phone::Gateway#mapper
|
236
236
|
- Loqate::Result::Failure#error
|
237
237
|
Summary::Length:
|
238
238
|
enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.7.0] - 2018-12-03
|
8
|
+
### Changed
|
9
|
+
- Moved the `Address`, `Email` and `Phone` APIs into their own namespaces
|
10
|
+
|
7
11
|
## [0.6.0] - 2018-12-03
|
8
12
|
### Added
|
9
13
|
- Bank API
|
@@ -53,6 +57,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
53
57
|
- Initial core functionality
|
54
58
|
- Codebase maintenance tools
|
55
59
|
|
60
|
+
[0.7.0]: https://github.com/wilsonsilva/loqate/compare/v0.6.0...v0.7.0
|
56
61
|
[0.6.0]: https://github.com/wilsonsilva/loqate/compare/v0.5.0...v0.6.0
|
57
62
|
[0.5.0]: https://github.com/wilsonsilva/loqate/compare/v0.4.0...v0.5.0
|
58
63
|
[0.4.0]: https://github.com/wilsonsilva/loqate/compare/v0.3.0...v0.4.0
|
data/README.md
CHANGED
@@ -114,7 +114,6 @@ selection.
|
|
114
114
|
|
115
115
|
```ruby
|
116
116
|
addresses = gateway.address.find!(text: 'EC1Y 8AF', country: 'GB', limit: 5)
|
117
|
-
|
118
117
|
addresses.first.id # => 'GB|RM|B|8144611'
|
119
118
|
```
|
120
119
|
|
@@ -138,17 +137,8 @@ a new phone number validation request.
|
|
138
137
|
|
139
138
|
```ruby
|
140
139
|
phone_validation = gateway.phone.validate!(phone: '+447440029210', country: 'GB')
|
141
|
-
|
142
|
-
phone_validation.
|
143
|
-
phone_validation.request_processed # => true
|
144
|
-
phone_validation.is_valid # => 'Yes' -> This is how Loqate defines validity
|
145
|
-
phone_validation.valid? # => true
|
146
|
-
phone_validation.network_code # => '26'
|
147
|
-
phone_validation.network_name # => 'Telefonica UK'
|
148
|
-
phone_validation.network_country # => 'GB'
|
149
|
-
phone_validation.national_format # => '07440 029210'
|
150
|
-
phone_validation.country_prefix # => 44
|
151
|
-
phone_validation.number_type # => 'Mobile'
|
140
|
+
phone_validation.phone_number # => '+447440029210'
|
141
|
+
phone_validation.valid? # => true
|
152
142
|
```
|
153
143
|
|
154
144
|
### Email API
|
@@ -162,37 +152,15 @@ validate multiple emails at once.
|
|
162
152
|
#### Validating an email address
|
163
153
|
```ruby
|
164
154
|
email_validation = gateway.email.validate!(email: 'person@gmail.com')
|
165
|
-
|
166
|
-
email_validation.response_code # => 'Valid'
|
167
|
-
email_validation.response_message # => 'Email address was fully validated'
|
168
|
-
email_validation.email_address # => 'person@gmail.com'
|
169
|
-
email_validation.user_account # => 'person'
|
170
|
-
email_validation.domain # => 'gmail.com'
|
171
|
-
email_validation.is_disposable_or_temporary # => false
|
172
|
-
email_validation.is_complainer_or_fraud_risk # => false
|
173
|
-
email_validation.duration # => 0.007366261
|
174
|
-
email_validation.valid? # => true
|
175
|
-
email_validation.valid_domain? # => true
|
176
|
-
email_validation.invalid? # => false
|
177
|
-
email_validation.timeout? # => false
|
155
|
+
email_validation.valid? # => true
|
178
156
|
```
|
179
157
|
|
180
158
|
#### Validating multiple email addresses
|
181
159
|
|
182
160
|
```ruby
|
183
161
|
email_validations = gateway.email.batch_validate!(emails: %w[person@gmail.com])
|
184
|
-
email_validation
|
185
|
-
|
186
|
-
email_validation.status # => 'Valid'
|
187
|
-
email_validation.email_address # => 'person@gmail.com'
|
188
|
-
email_validation.account # => 'person'
|
189
|
-
email_validation.domain # => 'gmail.com'
|
190
|
-
email_validation.is_disposible # => false
|
191
|
-
email_validation.is_system_mailbox # => false
|
192
|
-
email_validation.valid? # => true
|
193
|
-
email_validation.invalid? # => false
|
194
|
-
email_validation.unknown? # => false
|
195
|
-
email_validation.unverified? # => false
|
162
|
+
email_validation = email_validations.first
|
163
|
+
email_validation.valid? # => true
|
196
164
|
```
|
197
165
|
|
198
166
|
### Bank API
|
@@ -221,10 +189,10 @@ account_validation.correct? # => true
|
|
221
189
|
#### Validating multiple bank accounts
|
222
190
|
```ruby
|
223
191
|
accounts_validations = gateway.bank.batch_validate_accounts!(
|
224
|
-
account_numbers: %w[51065718
|
225
|
-
sort_codes: %w[40-41-31
|
192
|
+
account_numbers: %w[51065718 12001020],
|
193
|
+
sort_codes: %w[40-41-31 083210]
|
226
194
|
)
|
227
|
-
accounts_validations.first.correct?
|
195
|
+
accounts_validations.first.correct? # => true
|
228
196
|
accounts_validations.second.correct? # => false
|
229
197
|
```
|
230
198
|
|
data/ROADMAP.md
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
module Loqate
|
2
|
+
module Address
|
3
|
+
# A result from the address find service.
|
4
|
+
class Address < Dry::Struct::Value
|
5
|
+
# An address ID or a container ID for further results
|
6
|
+
#
|
7
|
+
# @return [String]
|
8
|
+
#
|
9
|
+
attribute :id, Types::Strict::String
|
10
|
+
|
11
|
+
# If the Type is 'Address' then the ID can be passed to the Retrieve service.
|
12
|
+
# Any other ID should be passed as the Container to a further Find request to get more results.
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
#
|
16
|
+
attribute :type, Types::Strict::String
|
17
|
+
|
18
|
+
# The name of the result
|
19
|
+
#
|
20
|
+
# @return [String]
|
21
|
+
#
|
22
|
+
attribute :text, Types::Strict::String
|
23
|
+
|
24
|
+
# A list of number ranges identifying the matched characters in the Text and Description
|
25
|
+
#
|
26
|
+
# @return [String]
|
27
|
+
#
|
28
|
+
attribute :highlight, Types::Strict::String
|
29
|
+
|
30
|
+
# Descriptive information about the result
|
31
|
+
#
|
32
|
+
# @return [String]
|
33
|
+
#
|
34
|
+
attribute :description, Types::Strict::String
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module Loqate
|
2
|
+
module Address
|
3
|
+
# A result from the address retrieve service.
|
4
|
+
class DetailedAddress
|
5
|
+
# For the first version, this will be a flat structure, exactly as it is defined in Loqate's API.
|
6
|
+
# But this many attributes is too much for a single object to hold.
|
7
|
+
#
|
8
|
+
# @api private
|
9
|
+
#
|
10
|
+
ATTRIBUTES = %i[
|
11
|
+
admin_area_code
|
12
|
+
admin_area_name
|
13
|
+
barcode
|
14
|
+
block
|
15
|
+
building_name
|
16
|
+
building_number
|
17
|
+
city
|
18
|
+
company
|
19
|
+
country_iso2
|
20
|
+
country_iso3
|
21
|
+
country_iso_number
|
22
|
+
country_name
|
23
|
+
data_level
|
24
|
+
department
|
25
|
+
district
|
26
|
+
domestic_id
|
27
|
+
field1
|
28
|
+
field2
|
29
|
+
field3
|
30
|
+
field4
|
31
|
+
field5
|
32
|
+
field6
|
33
|
+
field7
|
34
|
+
field8
|
35
|
+
field9
|
36
|
+
field10
|
37
|
+
field11
|
38
|
+
field12
|
39
|
+
field13
|
40
|
+
field14
|
41
|
+
field15
|
42
|
+
field16
|
43
|
+
field17
|
44
|
+
field18
|
45
|
+
field19
|
46
|
+
field20
|
47
|
+
id
|
48
|
+
label
|
49
|
+
language
|
50
|
+
language_alternatives
|
51
|
+
line1
|
52
|
+
line2
|
53
|
+
line3
|
54
|
+
line4
|
55
|
+
line5
|
56
|
+
neighbourhood
|
57
|
+
po_box_number
|
58
|
+
postal_code
|
59
|
+
province
|
60
|
+
province_code
|
61
|
+
province_name
|
62
|
+
secondary_street
|
63
|
+
sorting_number1
|
64
|
+
sorting_number2
|
65
|
+
street
|
66
|
+
sub_building
|
67
|
+
type
|
68
|
+
].freeze
|
69
|
+
|
70
|
+
ATTRIBUTES.each do |attribute|
|
71
|
+
attr_reader attribute
|
72
|
+
end
|
73
|
+
|
74
|
+
def initialize(options = {})
|
75
|
+
options.each_pair do |key, value|
|
76
|
+
instance_variable_set("@#{key}", value) if ATTRIBUTES.include?(key)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def ==(other)
|
81
|
+
other.is_a?(DetailedAddress) && id == other.id
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|