Class: PropertySolutions::Unit
- Inherits:
-
Object
- Object
- PropertySolutions::Unit
- Defined in:
- app/models/property_solutions/unit.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#disabled ⇒ Object
Returns the value of attribute disabled.
-
#id ⇒ Object
Returns the value of attribute id.
-
#long_desc ⇒ Object
Returns the value of attribute long_desc.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#short_desc ⇒ Object
Returns the value of attribute short_desc.
-
#type ⇒ Object
Returns the value of attribute type.
-
#website ⇒ Object
Returns the value of attribute website.
Instance Method Summary collapse
-
#initialize(arr) ⇒ Unit
constructor
A new instance of Unit.
- #parse(arr) ⇒ Object
Constructor Details
#initialize(arr) ⇒ Unit
Returns a new instance of Unit.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/property_solutions/unit.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
#address ⇒ Object
Returns the value of attribute address.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def address @address end |
#disabled ⇒ Object
Returns the value of attribute disabled.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def disabled @disabled end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def id @id end |
#long_desc ⇒ Object
Returns the value of attribute long_desc.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def long_desc @long_desc end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def phone @phone end |
#short_desc ⇒ Object
Returns the value of attribute short_desc.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def short_desc @short_desc end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def type @type end |
#website ⇒ Object
Returns the value of attribute website.
5 6 7 |
# File 'app/models/property_solutions/unit.rb', line 5 def website @website end |
Instance Method Details
#parse(arr) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/models/property_solutions/unit.rb', line 23 def parse(arr) @number = arr["@attributes"]["UnitNumber"] || "" @unit_id = arr["@attributes"]["PropertyUnitId"] || "" @unit_type_id = arr["@attributes"]["UnitTypeId"] || "" @floor_plan_id = arr["@attributes"]["FloorplanId"] || "" @floor_plan_name = arr["@attributes"]["FloorPlanName"] || "" @availability = arr["@attributes"]["Availability"] || "" # arr["Rent"] # # }, # "Rent"=>{ # "TermRent"=>[ # {"@attributes"=>{"LeaseTerm"=>6, "Rent"=>"0.00"}}, # {"@attributes"=>{"LeaseTerm"=>12, "Rent"=>"0.00"}}, # {"@attributes"=>{"LeaseTerm"=>18, "Rent"=>"0.00"}} # ], # "@attributes"=>{"MinRent"=>"0.00", "MaxRent"=>"0.00"} # }, # "Deposit"=>{ # "@attributes"=>{"MinDeposit"=>"0.00", "MaxDeposit"=>"200.00"} # } # }, end |