Module: YieldStarClient::AmenityMethods

Includes:
Validations
Included in:
Client
Defined in:
lib/yield_star_client/amenity_methods.rb

Instance Method Summary collapse

Methods included from Validations

#validate_client_name!, #validate_external_property_id!

Instance Method Details

#get_floor_plan_amenities(external_property_id, floor_plan_name) ⇒ Array<YieldStarClient::Amenity>

Retrieves all of the amenities associated with a specific floor plan.

Parameters:

  • external_property_id (String)

    the ID of the property where the floor plan is located

  • floor_plan_name (String)

    the name of the floor plan

Returns:

Raises:



33
34
35
36
37
38
39
40
41
42
# File 'lib/yield_star_client/amenity_methods.rb', line 33

def get_floor_plan_amenities(external_property_id, floor_plan_name)
  validate_external_property_id!(external_property_id)
  validate_required!(:floor_plan_name => floor_plan_name)

  response = send_soap_request(:get_floor_plan_amenities, :external_property_id => external_property_id, 
                                                          :floor_plan_name => floor_plan_name)

  amenities = response.to_hash[:get_floor_plan_amenities_response][:return][:amenity] || []
  [amenities].flatten.collect { |a| Amenity.new(a) }
end

#get_unit_amenities(external_property_id, unit_name, building = nil) ⇒ Array<YieldStarClient::Amenity>

Retrieves all of the amenities associated with a specific unit.

Parameters:

  • external_property_id (String)

    the ID of the property where the floor plan is located

  • unit_name (String)

    the name of the unit

  • building (optional, String) (defaults to: nil)

    the name of the building where the unit is located

Returns:

Raises:



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/yield_star_client/amenity_methods.rb', line 57

def get_unit_amenities(external_property_id, unit_name, building=nil)
  validate_external_property_id!(external_property_id)
  validate_required!(:unit_name => unit_name)

  body = {:external_property_id => external_property_id,
          :unit_name => unit_name}
  body[:building] = building if building

  response = send_soap_request(:get_unit_amenities, body)

  amenities = response.to_hash[:get_unit_amenities_response][:return][:amenity] || []
  [amenities].flatten.collect { |a| Amenity.new(a) }
end