Class: RealPage::DocumentParser::GuestCards::Prospects
- Defined in:
- lib/real_page/document_parser/guest_cards/prospects.rb
Overview
Parse the Prospects from a GuestCards response
Instance Attribute Summary
Attributes inherited from Base
#request_name, #request_params
Instance Method Summary collapse
-
#parse(prospects_hash) ⇒ Array<RealPage::Model::Prospect>
The prospects contained in this prospects_hash.
Methods inherited from Base
Constructor Details
This class inherits a constructor from RealPage::DocumentParser::Base
Instance Method Details
#parse(prospects_hash) ⇒ Array<RealPage::Model::Prospect>
Returns the prospects contained in this prospects_hash.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/real_page/document_parser/guest_cards/prospects.rb', line 15 def parse(prospects_hash) prospects(prospects_hash).map do |prospect| attrs = prospect.merge( 'PhoneNumbers' => phone_numbers(prospect['Numbers']) ) if prospect['Address'] attrs['Address'] = Model::Address.new(prospect['Address']) end # RealPage is inconsistent about Number vs PhoneNumber attrs.delete('Numbers') Model::Prospect.new(attrs) end end |