Class: PropertySolutions::Address

Inherits:
Object
  • Object
show all
Defined in:
app/models/property_solutions/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressObject

Returns the value of attribute address.



5
6
7
# File 'app/models/property_solutions/address.rb', line 5

def address
  @address
end

#cityObject

Returns the value of attribute city.



5
6
7
# File 'app/models/property_solutions/address.rb', line 5

def city
  @city
end

#countryObject

Returns the value of attribute country.



5
6
7
# File 'app/models/property_solutions/address.rb', line 5

def country
  @country
end

#stateObject

Returns the value of attribute state.



5
6
7
# File 'app/models/property_solutions/address.rb', line 5

def state
  @state
end

#zipObject

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