Class: PeterMueller::Address
- Inherits:
-
Object
- Object
- PeterMueller::Address
- Defined in:
- lib/peter-mueller/address.rb
Overview
A fictitious address. The address should look valid, but is not an existing address. The street might not even exist in the town. But, by accident, the address could exist.
Instance Attribute Summary collapse
-
#phone_prefix ⇒ Object
readonly
The landline phone prefix for the address.
-
#street_name ⇒ Object
readonly
Name of the town, the street and its numner.
-
#street_number ⇒ Object
readonly
Name of the town, the street and its numner.
-
#town ⇒ Object
readonly
Name of the town, the street and its numner.
-
#zip ⇒ Object
readonly
The zip code (PLZ).
Instance Method Summary collapse
-
#initialize ⇒ Address
constructor
Creates a new Address.
-
#street ⇒ Object
The streetname and the streetnumber in one string.
-
#to_s ⇒ Object
The string representation of the address.
Constructor Details
Instance Attribute Details
#phone_prefix ⇒ Object (readonly)
The landline phone prefix for the address. This can be used, when generating a Phonenumber which should fit with the address.
14 15 16 |
# File 'lib/peter-mueller/address.rb', line 14 def phone_prefix @phone_prefix end |
#street_name ⇒ Object (readonly)
Name of the town, the street and its numner.
10 11 12 |
# File 'lib/peter-mueller/address.rb', line 10 def street_name @street_name end |
#street_number ⇒ Object (readonly)
Name of the town, the street and its numner.
10 11 12 |
# File 'lib/peter-mueller/address.rb', line 10 def street_number @street_number end |
#town ⇒ Object (readonly)
Name of the town, the street and its numner.
10 11 12 |
# File 'lib/peter-mueller/address.rb', line 10 def town @town end |
#zip ⇒ Object (readonly)
The zip code (PLZ).
7 8 9 |
# File 'lib/peter-mueller/address.rb', line 7 def zip @zip end |
Instance Method Details
#street ⇒ Object
The streetname and the streetnumber in one string.
24 25 26 |
# File 'lib/peter-mueller/address.rb', line 24 def street "#{@street_name} #{@street_number}" end |
#to_s ⇒ Object
The string representation of the address.
29 30 31 |
# File 'lib/peter-mueller/address.rb', line 29 def to_s "#{street}\n#{zip} #{town}" end |