Class: RETS4R::ListingMapper
- Inherits:
-
Object
- Object
- RETS4R::ListingMapper
- Defined in:
- lib/rets4r/listing_mapper.rb
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ListingMapper
constructor
A new instance of ListingMapper.
- #map(original) ⇒ Object
- #select ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ ListingMapper
Returns a new instance of ListingMapper.
3 4 5 |
# File 'lib/rets4r/listing_mapper.rb', line 3 def initialize(params = {}) @select = params[:select] || ListingService.connection[:select] end |
Instance Method Details
#map(original) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/rets4r/listing_mapper.rb', line 9 def map(original) listing = {} @select.each_pair {|rets_key, record_key| listing[record_key] = original[rets_key] } listing end |
#select ⇒ Object
6 7 8 |
# File 'lib/rets4r/listing_mapper.rb', line 6 def select @select end |