Class: Unit::Types::Address
- Inherits:
-
Object
- Object
- Unit::Types::Address
- Defined in:
- lib/unit/types/address.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#street ⇒ Object
readonly
Returns the value of attribute street.
-
#street2 ⇒ Object
readonly
Returns the value of attribute street2.
Instance Method Summary collapse
-
#initialize(street, city, state, postal_code, country, street2 = nil) ⇒ Address
constructor
A new instance of Address.
- #represent ⇒ Object
Constructor Details
#initialize(street, city, state, postal_code, country, street2 = nil) ⇒ Address
Returns a new instance of Address.
14 15 16 17 18 19 20 21 |
# File 'lib/unit/types/address.rb', line 14 def initialize(street, city, state, postal_code, country, street2 = nil) @street = street @street2 = street2 @city = city @state = state @postal_code = postal_code @country = country end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
6 7 8 |
# File 'lib/unit/types/address.rb', line 6 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
6 7 8 |
# File 'lib/unit/types/address.rb', line 6 def country @country end |
#postal_code ⇒ Object (readonly)
Returns the value of attribute postal_code.
6 7 8 |
# File 'lib/unit/types/address.rb', line 6 def postal_code @postal_code end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/unit/types/address.rb', line 6 def state @state end |
#street ⇒ Object (readonly)
Returns the value of attribute street.
6 7 8 |
# File 'lib/unit/types/address.rb', line 6 def street @street end |
#street2 ⇒ Object (readonly)
Returns the value of attribute street2.
6 7 8 |
# File 'lib/unit/types/address.rb', line 6 def street2 @street2 end |
Instance Method Details
#represent ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/unit/types/address.rb', line 23 def represent { street: street, street2: street2, city: city, state: state, postalCode: postal_code, country: country } end |