Class: Addressing::Address
- Inherits:
-
Object
- Object
- Addressing::Address
- Defined in:
- lib/addressing/address.rb
Instance Attribute Summary collapse
-
#additional_name ⇒ Object
readonly
Returns the value of attribute additional_name.
-
#address_line1 ⇒ Object
readonly
Returns the value of attribute address_line1.
-
#address_line2 ⇒ Object
readonly
Returns the value of attribute address_line2.
-
#administrative_area ⇒ Object
readonly
Returns the value of attribute administrative_area.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#dependent_locality ⇒ Object
readonly
Returns the value of attribute dependent_locality.
-
#family_name ⇒ Object
readonly
Returns the value of attribute family_name.
-
#given_name ⇒ Object
readonly
Returns the value of attribute given_name.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#locality ⇒ Object
readonly
Returns the value of attribute locality.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#sorting_code ⇒ Object
readonly
Returns the value of attribute sorting_code.
Instance Method Summary collapse
-
#initialize(country_code: "", administrative_area: "", locality: "", dependent_locality: "", postal_code: "", sorting_code: "", address_line1: "", address_line2: "", organization: "", given_name: "", additional_name: "", family_name: "", locale: "und") ⇒ Address
constructor
A new instance of Address.
- #with_additional_name(additional_name) ⇒ Object
- #with_address_line1(address_line1) ⇒ Object
- #with_address_line2(address_line2) ⇒ Object
- #with_administrative_area(administrative_area) ⇒ Object
- #with_country_code(country_code) ⇒ Object
- #with_dependent_locality(dependent_locality) ⇒ Object
- #with_family_name(family_name) ⇒ Object
- #with_given_name(given_name) ⇒ Object
- #with_locale(locale) ⇒ Object
- #with_locality(locality) ⇒ Object
- #with_organization(organization) ⇒ Object
- #with_postal_code(postal_code) ⇒ Object
- #with_sorting_code(sorting_code) ⇒ Object
Constructor Details
#initialize(country_code: "", administrative_area: "", locality: "", dependent_locality: "", postal_code: "", sorting_code: "", address_line1: "", address_line2: "", organization: "", given_name: "", additional_name: "", family_name: "", locale: "und") ⇒ Address
Returns a new instance of Address.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/addressing/address.rb', line 7 def initialize(country_code: "", administrative_area: "", locality: "", dependent_locality: "", postal_code: "", sorting_code: "", address_line1: "", address_line2: "", organization: "", given_name: "", additional_name: "", family_name: "", locale: "und") @country_code = country_code @administrative_area = administrative_area @locality = locality @dependent_locality = dependent_locality @postal_code = postal_code @sorting_code = sorting_code @address_line1 = address_line1 @address_line2 = address_line2 @organization = organization @given_name = given_name @additional_name = additional_name @family_name = family_name @locale = locale end |
Instance Attribute Details
#additional_name ⇒ Object
Returns the value of attribute additional_name.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def additional_name @additional_name end |
#address_line1 ⇒ Object
Returns the value of attribute address_line1.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def address_line1 @address_line1 end |
#address_line2 ⇒ Object
Returns the value of attribute address_line2.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def address_line2 @address_line2 end |
#administrative_area ⇒ Object
Returns the value of attribute administrative_area.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def administrative_area @administrative_area end |
#country_code ⇒ Object
Returns the value of attribute country_code.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def country_code @country_code end |
#dependent_locality ⇒ Object
Returns the value of attribute dependent_locality.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def dependent_locality @dependent_locality end |
#family_name ⇒ Object
Returns the value of attribute family_name.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def family_name @family_name end |
#given_name ⇒ Object
Returns the value of attribute given_name.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def given_name @given_name end |
#locale ⇒ Object
Returns the value of attribute locale.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def locale @locale end |
#locality ⇒ Object
Returns the value of attribute locality.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def locality @locality end |
#organization ⇒ Object
Returns the value of attribute organization.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def organization @organization end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def postal_code @postal_code end |
#sorting_code ⇒ Object
Returns the value of attribute sorting_code.
5 6 7 |
# File 'lib/addressing/address.rb', line 5 def sorting_code @sorting_code end |
Instance Method Details
#with_additional_name(additional_name) ⇒ Object
83 84 85 86 87 |
# File 'lib/addressing/address.rb', line 83 def with_additional_name(additional_name) address = clone address.additional_name = additional_name address end |
#with_address_line1(address_line1) ⇒ Object
59 60 61 62 63 |
# File 'lib/addressing/address.rb', line 59 def with_address_line1(address_line1) address = clone address.address_line1 = address_line1 address end |
#with_address_line2(address_line2) ⇒ Object
65 66 67 68 69 |
# File 'lib/addressing/address.rb', line 65 def with_address_line2(address_line2) address = clone address.address_line2 = address_line2 address end |
#with_administrative_area(administrative_area) ⇒ Object
29 30 31 32 33 |
# File 'lib/addressing/address.rb', line 29 def with_administrative_area(administrative_area) address = clone address.administrative_area = administrative_area address end |
#with_country_code(country_code) ⇒ Object
23 24 25 26 27 |
# File 'lib/addressing/address.rb', line 23 def with_country_code(country_code) address = clone address.country_code = country_code address end |
#with_dependent_locality(dependent_locality) ⇒ Object
41 42 43 44 45 |
# File 'lib/addressing/address.rb', line 41 def with_dependent_locality(dependent_locality) address = clone address.dependent_locality = dependent_locality address end |
#with_family_name(family_name) ⇒ Object
89 90 91 92 93 |
# File 'lib/addressing/address.rb', line 89 def with_family_name(family_name) address = clone address.family_name = family_name address end |
#with_given_name(given_name) ⇒ Object
77 78 79 80 81 |
# File 'lib/addressing/address.rb', line 77 def with_given_name(given_name) address = clone address.given_name = given_name address end |
#with_locale(locale) ⇒ Object
95 96 97 98 99 |
# File 'lib/addressing/address.rb', line 95 def with_locale(locale) address = clone address.locale = locale address end |
#with_locality(locality) ⇒ Object
35 36 37 38 39 |
# File 'lib/addressing/address.rb', line 35 def with_locality(locality) address = clone address.locality = locality address end |
#with_organization(organization) ⇒ Object
71 72 73 74 75 |
# File 'lib/addressing/address.rb', line 71 def with_organization(organization) address = clone address.organization = organization address end |
#with_postal_code(postal_code) ⇒ Object
47 48 49 50 51 |
# File 'lib/addressing/address.rb', line 47 def with_postal_code(postal_code) address = clone address.postal_code = postal_code address end |
#with_sorting_code(sorting_code) ⇒ Object
53 54 55 56 57 |
# File 'lib/addressing/address.rb', line 53 def with_sorting_code(sorting_code) address = clone address.sorting_code = sorting_code address end |