Class: Mannequin::Address
- Inherits:
-
Object
- Object
- Mannequin::Address
- Defined in:
- lib/mannequin/address.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#state_code ⇒ Object
readonly
Returns the value of attribute state_code.
-
#street_address ⇒ Object
readonly
Returns the value of attribute street_address.
-
#street_name ⇒ Object
readonly
Returns the value of attribute street_name.
-
#street_number ⇒ Object
readonly
Returns the value of attribute street_number.
-
#street_type ⇒ Object
readonly
Returns the value of attribute street_type.
Instance Method Summary collapse
-
#initialize ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize ⇒ Address
Returns a new instance of Address.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mannequin/address.rb', line 5 def initialize # Set variables from functions street_number = generated_street_number street_name = generated_street_name street_type = generated_street_type street_address = "#{street_number} #{street_name} #{street_type}" city = generated_city state = generated_state country = generated_country # Initialize attributes @street_address = street_address @street_number = street_number @street_name = street_name @street_type = street_type @city = city @state = state[1] @state_code = state[0] @country = country end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def country @country end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def state @state end |
#state_code ⇒ Object (readonly)
Returns the value of attribute state_code.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def state_code @state_code end |
#street_address ⇒ Object (readonly)
Returns the value of attribute street_address.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def street_address @street_address end |
#street_name ⇒ Object (readonly)
Returns the value of attribute street_name.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def street_name @street_name end |
#street_number ⇒ Object (readonly)
Returns the value of attribute street_number.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def street_number @street_number end |
#street_type ⇒ Object (readonly)
Returns the value of attribute street_type.
3 4 5 |
# File 'lib/mannequin/address.rb', line 3 def street_type @street_type end |