Class: PropertySolutions::Address
- Inherits:
-
Object
- Object
- PropertySolutions::Address
- Defined in:
- app/models/property_solutions/address.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#state ⇒ Object
Returns the value of attribute state.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(arr = nil) ⇒ Address
constructor
A new instance of Address.
- #parse(arr) ⇒ Object
Constructor Details
#initialize(arr = nil) ⇒ Address
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/models/property_solutions/address.rb', line 7 def initialize(arr = nil) if (arr.nil?) @address = "" @city = "" @state = "" @zip = "" @country = "" else parse(arr) end end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
5 6 7 |
# File 'app/models/property_solutions/address.rb', line 5 def address @address end |
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'app/models/property_solutions/address.rb', line 5 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'app/models/property_solutions/address.rb', line 5 def country @country end |
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'app/models/property_solutions/address.rb', line 5 def state @state end |
#zip ⇒ Object
Returns the value of attribute zip.
5 6 7 |
# File 'app/models/property_solutions/address.rb', line 5 def zip @zip end |
Instance Method Details
#parse(arr) ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/models/property_solutions/address.rb', line 19 def parse(arr) @address = arr['Address'] || "" @city = arr['City'] || "" @state = arr['State'] || "" @zip = arr['PostalCode'] || "" @country = arr['Country'] || "" end |