Class: Workarea::Listrak::Models::Address
- Inherits:
-
Object
- Object
- Workarea::Listrak::Models::Address
- Defined in:
- app/services/workarea/listrak/models/address.rb
Instance Attribute Summary collapse
-
#workarea_address ⇒ Object
readonly
Returns the value of attribute workarea_address.
Instance Method Summary collapse
-
#address1 ⇒ String
Home address line 1.
-
#address2 ⇒ String
Home address line 2.
-
#address3 ⇒ String
Home address line 3.
- #as_json ⇒ Object
-
#city ⇒ String
Home address city.
-
#country ⇒ String
Home address country.
-
#initialize(workarea_address) ⇒ Address
constructor
A new instance of Address.
-
#state ⇒ String
Home address state.
Constructor Details
#initialize(workarea_address) ⇒ Address
Returns a new instance of Address.
7 8 9 |
# File 'app/services/workarea/listrak/models/address.rb', line 7 def initialize(workarea_address) @workarea_address = workarea_address end |
Instance Attribute Details
#workarea_address ⇒ Object (readonly)
Returns the value of attribute workarea_address.
5 6 7 |
# File 'app/services/workarea/listrak/models/address.rb', line 5 def workarea_address @workarea_address end |
Instance Method Details
#address1 ⇒ String
Home address line 1
limited to 100 characters
28 29 30 |
# File 'app/services/workarea/listrak/models/address.rb', line 28 def address1 workarea_address.street.to_s[0...100] end |
#address2 ⇒ String
Home address line 2
limited to 100 characters
38 39 40 |
# File 'app/services/workarea/listrak/models/address.rb', line 38 def address2 workarea_address.street_2.to_s[0..100] end |
#address3 ⇒ String
Home address line 3
limited to 100 characters
48 49 |
# File 'app/services/workarea/listrak/models/address.rb', line 48 def address3 end |
#as_json ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/workarea/listrak/models/address.rb', line 11 def as_json { address1: address1, address2: address2, address3: address3, city: city, country: country, state: state }.compact end |
#city ⇒ String
Home address city
limited to 100 characters
57 58 59 |
# File 'app/services/workarea/listrak/models/address.rb', line 57 def city workarea_address.city.to_s[0...100] end |
#country ⇒ String
Home address country
limited to 100 characters
67 68 69 |
# File 'app/services/workarea/listrak/models/address.rb', line 67 def country workarea_address.country.name[0...100] end |
#state ⇒ String
Home address state
limited to 100 characters
77 78 79 |
# File 'app/services/workarea/listrak/models/address.rb', line 77 def state workarea_address.region.to_s[0...100] end |