Class: AtlasEngine::AddressValidation::ConcernRecord
- Inherits:
-
Object
- Object
- AtlasEngine::AddressValidation::ConcernRecord
- Extended by:
- T::Sig
- Defined in:
- app/models/atlas_engine/address_validation/concern_record.rb
Instance Attribute Summary collapse
-
#address1 ⇒ Object
readonly
Returns the value of attribute address1.
-
#address2 ⇒ Object
readonly
Returns the value of attribute address2.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#client_request_id ⇒ Object
readonly
Returns the value of attribute client_request_id.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#line2 ⇒ Object
readonly
Returns the value of attribute line2.
-
#neighborhood ⇒ Object
readonly
Returns the value of attribute neighborhood.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#province_code ⇒ Object
readonly
Returns the value of attribute province_code.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#street_name ⇒ Object
readonly
Returns the value of attribute street_name.
-
#street_number ⇒ Object
readonly
Returns the value of attribute street_number.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
- #address_attributes ⇒ Object
-
#initialize(request_id: nil, timestamp: Time.zone.now, origin: "", address1: "", street_name: "", street_number: "", address2: "", line2: "", neighborhood: "", city: "", province_code: "", country_code: "", zip: "", phone: "", result: Result.new) ⇒ ConcernRecord
constructor
A new instance of ConcernRecord.
Constructor Details
#initialize(request_id: nil, timestamp: Time.zone.now, origin: "", address1: "", street_name: "", street_number: "", address2: "", line2: "", neighborhood: "", city: "", province_code: "", country_code: "", zip: "", phone: "", result: Result.new) ⇒ ConcernRecord
Returns a new instance of ConcernRecord.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 101 def initialize( request_id: nil, timestamp: Time.zone.now, origin: "", address1: "", street_name: "", street_number: "", address2: "", line2: "", neighborhood: "", city: "", province_code: "", country_code: "", zip: "", phone: "", result: Result.new ) @request_id = request_id @client_request_id = T.let(result.client_request_id, T.nilable(String)) @timestamp = @origin = origin @address1 = address1 @street_name = street_name @street_number = street_number @address2 = address2 @line2 = line2 @neighborhood = neighborhood @city = city @province_code = province_code @country_code = country_code @zip = zip @phone = phone @result = result @version = T.let(Rails.configuration.version, T.nilable(String)) end |
Instance Attribute Details
#address1 ⇒ Object (readonly)
Returns the value of attribute address1.
10 11 12 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 10 def address1 @address1 end |
#address2 ⇒ Object (readonly)
Returns the value of attribute address2.
19 20 21 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 19 def address2 @address2 end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
28 29 30 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 28 def city @city end |
#client_request_id ⇒ Object (readonly)
Returns the value of attribute client_request_id.
52 53 54 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 52 def client_request_id @client_request_id end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
31 32 33 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 31 def country_code @country_code end |
#line2 ⇒ Object (readonly)
Returns the value of attribute line2.
22 23 24 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 22 def line2 @line2 end |
#neighborhood ⇒ Object (readonly)
Returns the value of attribute neighborhood.
25 26 27 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 25 def neighborhood @neighborhood end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
58 59 60 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 58 def origin @origin end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
40 41 42 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 40 def phone @phone end |
#province_code ⇒ Object (readonly)
Returns the value of attribute province_code.
34 35 36 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 34 def province_code @province_code end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
49 50 51 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 49 def request_id @request_id end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
43 44 45 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 43 def result @result end |
#street_name ⇒ Object (readonly)
Returns the value of attribute street_name.
13 14 15 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 13 def street_name @street_name end |
#street_number ⇒ Object (readonly)
Returns the value of attribute street_number.
16 17 18 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 16 def street_number @street_number end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
55 56 57 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 55 def @timestamp end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
46 47 48 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 46 def version @version end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
37 38 39 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 37 def zip @zip end |
Class Method Details
.duplicate(obj) ⇒ Object
77 78 79 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 77 def duplicate(obj) Marshal.load(Marshal.dump(obj)) end |
.from_result(result, context = {}) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 64 def from_result(result, context = {}) new( **T.unsafe( { result: duplicate(result), **result.address, **context.except(:client_request_id), }, ), ) end |
Instance Method Details
#address_attributes ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 138 def address_attributes { address1: address1, street_name: street_name, street_number: street_number, address2: address2, line2: line2, neighborhood: neighborhood, city: city, province_code: province_code, zip: zip, country_code: country_code, phone: phone, } end |