Class: Ordrin::Data::Address
- Inherits:
-
OrdrinData
- Object
- OrdrinData
- Ordrin::Data::Address
- Defined in:
- lib/ordrin/data.rb
Overview
Represents a street address
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#addr2 ⇒ Object
readonly
Returns the value of attribute addr2.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(addr, city, state, zip, phone, addr2 = '') ⇒ Address
constructor
Store the parts of the address as fields in this object.
Methods inherited from OrdrinData
Constructor Details
#initialize(addr, city, state, zip, phone, addr2 = '') ⇒ Address
Store the parts of the address as fields in this object. Arguments: addr – Street address city – City state – State zip – Zip code phone – Phone number addr2 – Optional second street address line
29 30 31 32 33 34 35 36 |
# File 'lib/ordrin/data.rb', line 29 def initialize(addr, city, state, zip, phone, addr2='') @fields = [:addr, :city, :state, :zip, :phone, :addr2] @addr = addr @city = city @state = Normalize.normalize(state, :state) @zip = Normalize.normalize(zip, :zip) @phone = Normalize.normalize(phone, :phone) end |
Instance Attribute Details
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def addr @addr end |
#addr2 ⇒ Object (readonly)
Returns the value of attribute addr2.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def addr2 @addr2 end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def city @city end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def fields @fields end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def phone @phone end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def state @state end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
19 20 21 |
# File 'lib/ordrin/data.rb', line 19 def zip @zip end |