Class: SwissMatch::Directories::Address
- Inherits:
-
Struct
- Object
- Struct
- SwissMatch::Directories::Address
- Defined in:
- lib/swissmatch/directories/address.rb
Overview
Represents a swiss address. Used by directory service interfaces to return search results.
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#maiden_name ⇒ Object
Returns the value of attribute maiden_name.
-
#street_name ⇒ Object
Returns the value of attribute street_name.
-
#street_number ⇒ Object
Returns the value of attribute street_number.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#family_name ⇒ String
The full family name, including the maiden name.
-
#full_name ⇒ String
The full name, consisting of first_name and family_name.
-
#street ⇒ String
The street and street number.
-
#to_s ⇒ String
A halfway readable textual representation.
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def city @city end |
#first_name ⇒ Object
Returns the value of attribute first_name
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def gender @gender end |
#last_name ⇒ Object
Returns the value of attribute last_name
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def last_name @last_name end |
#maiden_name ⇒ Object
Returns the value of attribute maiden_name
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def maiden_name @maiden_name end |
#street_name ⇒ Object
Returns the value of attribute street_name
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def street_name @street_name end |
#street_number ⇒ Object
Returns the value of attribute street_number
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def street_number @street_number end |
#zip_code ⇒ Object
Returns the value of attribute zip_code
10 11 12 |
# File 'lib/swissmatch/directories/address.rb', line 10 def zip_code @zip_code end |
Instance Method Details
#family_name ⇒ String
I ([email protected]) am not sure whether “last_name (-maiden_name)” is the proper form. The output might be changed in a future version The current output is based on how tel.search.ch displays the name.
Returns The full family name, including the maiden name.
31 32 33 |
# File 'lib/swissmatch/directories/address.rb', line 31 def family_name maiden_name ? "#{last_name} (-#{maiden_name})" : last_name end |
#full_name ⇒ String
Returns The full name, consisting of first_name and family_name.
20 21 22 |
# File 'lib/swissmatch/directories/address.rb', line 20 def full_name "#{first_name} #{family_name}" end |
#street ⇒ String
Returns The street and street number.
14 15 16 |
# File 'lib/swissmatch/directories/address.rb', line 14 def street [street_name, street_number].compact.join(" ") end |
#to_s ⇒ String
Returns A halfway readable textual representation.
36 37 38 |
# File 'lib/swissmatch/directories/address.rb', line 36 def to_s "#{full_name}\n#{street}\n#{zip_code} #{city}" end |