Class: Addressing::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/addressing/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(country_code: "", administrative_area: "", locality: "", dependent_locality: "", postal_code: "", sorting_code: "", address_line1: "", address_line2: "", address_line3: "", 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
22
# File 'lib/addressing/address.rb', line 7

def initialize(country_code: "", administrative_area: "", locality: "", dependent_locality: "", postal_code: "", sorting_code: "", address_line1: "", address_line2: "", address_line3: "", 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
  @address_line3 = address_line3
  @organization = organization
  @given_name = given_name
  @additional_name = additional_name
  @family_name = family_name
  @locale = locale
end

Instance Attribute Details

#additional_nameObject

Returns the value of attribute additional_name.



5
6
7
# File 'lib/addressing/address.rb', line 5

def additional_name
  @additional_name
end

#address_line1Object

Returns the value of attribute address_line1.



5
6
7
# File 'lib/addressing/address.rb', line 5

def address_line1
  @address_line1
end

#address_line2Object

Returns the value of attribute address_line2.



5
6
7
# File 'lib/addressing/address.rb', line 5

def address_line2
  @address_line2
end

#address_line3Object

Returns the value of attribute address_line3.



5
6
7
# File 'lib/addressing/address.rb', line 5

def address_line3
  @address_line3
end

#administrative_areaObject

Returns the value of attribute administrative_area.



5
6
7
# File 'lib/addressing/address.rb', line 5

def administrative_area
  @administrative_area
end

#country_codeObject

Returns the value of attribute country_code.



5
6
7
# File 'lib/addressing/address.rb', line 5

def country_code
  @country_code
end

#dependent_localityObject

Returns the value of attribute dependent_locality.



5
6
7
# File 'lib/addressing/address.rb', line 5

def dependent_locality
  @dependent_locality
end

#family_nameObject

Returns the value of attribute family_name.



5
6
7
# File 'lib/addressing/address.rb', line 5

def family_name
  @family_name
end

#given_nameObject

Returns the value of attribute given_name.



5
6
7
# File 'lib/addressing/address.rb', line 5

def given_name
  @given_name
end

#localeObject

Returns the value of attribute locale.



5
6
7
# File 'lib/addressing/address.rb', line 5

def locale
  @locale
end

#localityObject

Returns the value of attribute locality.



5
6
7
# File 'lib/addressing/address.rb', line 5

def locality
  @locality
end

#organizationObject

Returns the value of attribute organization.



5
6
7
# File 'lib/addressing/address.rb', line 5

def organization
  @organization
end

#postal_codeObject

Returns the value of attribute postal_code.



5
6
7
# File 'lib/addressing/address.rb', line 5

def postal_code
  @postal_code
end

#sorting_codeObject

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



90
91
92
93
94
# File 'lib/addressing/address.rb', line 90

def with_additional_name(additional_name)
  address = clone
  address.additional_name = additional_name
  address
end

#with_address_line1(address_line1) ⇒ Object



60
61
62
63
64
# File 'lib/addressing/address.rb', line 60

def with_address_line1(address_line1)
  address = clone
  address.address_line1 = address_line1
  address
end

#with_address_line2(address_line2) ⇒ Object



66
67
68
69
70
# File 'lib/addressing/address.rb', line 66

def with_address_line2(address_line2)
  address = clone
  address.address_line2 = address_line2
  address
end

#with_address_line3(address_line3) ⇒ Object



72
73
74
75
76
# File 'lib/addressing/address.rb', line 72

def with_address_line3(address_line3)
  address = clone
  address.address_line3 = address_line3
  address
end

#with_administrative_area(administrative_area) ⇒ Object



30
31
32
33
34
# File 'lib/addressing/address.rb', line 30

def with_administrative_area(administrative_area)
  address = clone
  address.administrative_area = administrative_area
  address
end

#with_country_code(country_code) ⇒ Object



24
25
26
27
28
# File 'lib/addressing/address.rb', line 24

def with_country_code(country_code)
  address = clone
  address.country_code = country_code
  address
end

#with_dependent_locality(dependent_locality) ⇒ Object



42
43
44
45
46
# File 'lib/addressing/address.rb', line 42

def with_dependent_locality(dependent_locality)
  address = clone
  address.dependent_locality = dependent_locality
  address
end

#with_family_name(family_name) ⇒ Object



96
97
98
99
100
# File 'lib/addressing/address.rb', line 96

def with_family_name(family_name)
  address = clone
  address.family_name = family_name
  address
end

#with_given_name(given_name) ⇒ Object



84
85
86
87
88
# File 'lib/addressing/address.rb', line 84

def with_given_name(given_name)
  address = clone
  address.given_name = given_name
  address
end

#with_locale(locale) ⇒ Object



102
103
104
105
106
# File 'lib/addressing/address.rb', line 102

def with_locale(locale)
  address = clone
  address.locale = locale
  address
end

#with_locality(locality) ⇒ Object



36
37
38
39
40
# File 'lib/addressing/address.rb', line 36

def with_locality(locality)
  address = clone
  address.locality = locality
  address
end

#with_organization(organization) ⇒ Object



78
79
80
81
82
# File 'lib/addressing/address.rb', line 78

def with_organization(organization)
  address = clone
  address.organization = organization
  address
end

#with_postal_code(postal_code) ⇒ Object



48
49
50
51
52
# File 'lib/addressing/address.rb', line 48

def with_postal_code(postal_code)
  address = clone
  address.postal_code = postal_code
  address
end

#with_sorting_code(sorting_code) ⇒ Object



54
55
56
57
58
# File 'lib/addressing/address.rb', line 54

def with_sorting_code(sorting_code)
  address = clone
  address.sorting_code = sorting_code
  address
end