Module: YieldStarClient::RentMethods

Included in:
Client
Defined in:
lib/yield_star_client/rent_methods.rb

Instance Method Summary collapse

Instance Method Details

#get_available_units(external_property_id) ⇒ Array<YieldStarClient::AvailableFloorPlan>

Retrieves rental information for all currently available units at a specific property, grouped by floor plan.

Parameters:

  • external_property_id (String)

    the ID of the property where the available units are located

Returns:

Raises:



159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/yield_star_client/rent_methods.rb', line 159

def get_available_units(external_property_id)
  validate_external_property_id!(external_property_id)

  response = send_soap_request(:get_available_units, :external_property_id => external_property_id)

  data = response.to_hash[:get_available_units_response][:return]
  base_props = data.reject { |k,v| ![:external_property_id, :effective_date].include?(k) }

  floor_plans = []
  floor_plans << data[:floor_plan] if data[:floor_plan]

  floor_plans.flatten.collect { |fp| AvailableFloorPlan.new(base_props.merge(fp)) }
end

#get_rent_summary(external_property_id) ⇒ Array<YieldStarClient::RentSummary>

Retrieves high-level rent information for all currently available floor plans within a specific property.

Parameters:

  • external_property_id (String)

    the ID of the property associated with the requested data

Returns:

Raises:



131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/yield_star_client/rent_methods.rb', line 131

def get_rent_summary(external_property_id)
  validate_external_property_id!(external_property_id)

  response = send_soap_request(:get_rent_summary, :external_property_id => external_property_id)

  data = response.to_hash[:get_rent_summary_response][:return]
  shared_props = {:external_property_id => data[:external_property_id],
                  :effective_date => data[:effective_date]}
  summaries = []
  summaries << data[:floor_plan_unit_type] if data[:floor_plan_unit_type]

  summaries.flatten.collect { |s| RentSummary.new(shared_props.merge(s)) }
end