Class: RETS4R::ListingMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rets4r/listing_mapper.rb

Instance Method Summary collapse

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

#selectObject



6
7
8
# File 'lib/rets4r/listing_mapper.rb', line 6

def select
  @select
end