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.
-
#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.
-
#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: "", address2: "", 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: "", address2: "", city: "", province_code: "", country_code: "", zip: "", phone: "", result: Result.new) ⇒ ConcernRecord
Returns a new instance of ConcernRecord.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 85 def initialize( request_id: nil, timestamp: Time.zone.now, origin: "", address1: "", address2: "", 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 @address2 = address2 @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.
13 14 15 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 13 def address2 @address2 end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
16 17 18 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 16 def city @city end |
#client_request_id ⇒ Object (readonly)
Returns the value of attribute client_request_id.
40 41 42 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 40 def client_request_id @client_request_id end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
19 20 21 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 19 def country_code @country_code end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
46 47 48 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 46 def origin @origin end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
28 29 30 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 28 def phone @phone end |
#province_code ⇒ Object (readonly)
Returns the value of attribute province_code.
22 23 24 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 22 def province_code @province_code end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
37 38 39 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 37 def request_id @request_id end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
31 32 33 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 31 def result @result end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
43 44 45 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 43 def @timestamp end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
34 35 36 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 34 def version @version end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
25 26 27 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 25 def zip @zip end |
Class Method Details
.duplicate(obj) ⇒ Object
65 66 67 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 65 def duplicate(obj) Marshal.load(Marshal.dump(obj)) end |
.from_result(result, context = {}) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 52 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
114 115 116 117 118 119 120 121 122 123 124 |
# File 'app/models/atlas_engine/address_validation/concern_record.rb', line 114 def address_attributes { address1: address1, address2: address2, city: city, province_code: province_code, zip: zip, country_code: country_code, phone: phone, } end |