Class: RealPage::DocumentParser::GuestCards::Amenities
- Defined in:
- lib/real_page/document_parser/guest_cards/amenities.rb
Overview
Parse the Amenities from a GuestCards response. RealPage spells everything “amentities”, so we also correct for that.
Instance Attribute Summary
Attributes inherited from Base
#request_name, #request_params
Instance Method Summary collapse
-
#parse(amenities_hash) ⇒ Array<RealPage::Model::Amenity>
The amenities contained in this amenities_hash.
Methods inherited from Base
Constructor Details
This class inherits a constructor from RealPage::DocumentParser::Base
Instance Method Details
#parse(amenities_hash) ⇒ Array<RealPage::Model::Amenity>
Returns the amenities contained in this amenities_hash.
16 17 18 19 20 21 22 23 |
# File 'lib/real_page/document_parser/guest_cards/amenities.rb', line 16 def parse(amenities_hash) amenities(amenities_hash).map do |amenity| attrs = amenity.dup # RealPage spells AmenityID wrong attrs['AmenityID'] = attrs.delete('AmentityID') Model::Amenity.new(attrs) end end |