Class: PropertySolutions::Property

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arr) ⇒ Property

Returns a new instance of Property.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/property_solutions/property.rb', line 7

def initialize(arr)
  if (arr.nil?)
    @id          = ""
    @name        = ""
    @type        = ""
    @short_desc  = ""
    @long_desc   = ""
    @website     = ""
    @address     = Address.new
    @phone       = Phone.new
    @disabled    = false
  else
    parse(arr)
  end
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



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

def address
  @address
end

#disabledObject

Returns the value of attribute disabled.



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

def disabled
  @disabled
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#long_descObject

Returns the value of attribute long_desc.



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

def long_desc
  @long_desc
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#phoneObject

Returns the value of attribute phone.



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

def phone
  @phone
end

#short_descObject

Returns the value of attribute short_desc.



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

def short_desc
  @short_desc
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#websiteObject

Returns the value of attribute website.



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

def website
  @website
end

Instance Method Details

#parse(arr) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/property_solutions/property.rb', line 23

def parse(arr)
  @id          = arr['PropertyID']        || "" 
  @name        = arr['MarketingName']     || ""
  @type        = arr['Apartment']         || ""
  @short_desc  = arr['ShortDescription']  || ""
  @long_desc   = arr['LongDescription']   || ""
  @website     = arr['webSite']           || ""
  @address     = Address.new(arr['Address'])
  @phone       = Phone.new(arr['Phone'])
  @disabled    = arr['IsDisabled']        || ""
end