Class: PropertySolutions::Units

Inherits:
ApiConsumer show all
Defined in:
app/models/property_solutions/units.rb

Constant Summary collapse

@@field_order =
'id'
@@base =
'propertyunits'

Class Method Summary collapse

Methods inherited from ApiConsumer

request, sort

Class Method Details

.where(options) ⇒ Object

Pulls a list of Unit availability and their pricing



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

def self.where(options)
  resp = self.request('getUnitsAvailabilityAndPricing', {
    'propertyId'         => options['property_id'],   # [Integer] required
    'floorplanId'        => options['floor_plan_id'], # [Integer] optional
    'unitTypeId'         => options['unit_type_id'],  # [Integer] optional
    'propertyUnitId'     => options['unit_id'],       # [Integer] optional
    'availableUnitsOnly' => options['available']      # [Boolean] optional
  })
  return resp
  #return [] if !resp || resp['PhysicalProperty'].nil? || resp['PhysicalProperty']['Property'].nil?
  #units = resp['PhysicalProperty']['Property'].collect { |p| Property.new(p) }
  #units = self.sort(units)
  #return units
end