Skip to content

Commit

Permalink
add a mapper example
Browse files Browse the repository at this point in the history
  • Loading branch information
josephholsten committed Jul 2, 2010
1 parent 860fe1a commit f6376ea
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/client_mapper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env ruby

$:.unshift 'lib'
require 'rets4r'
require 'yaml'

listing_service_config_file = File.expand_path(File.join(File.dirname(__FILE__), "settings.yml"))
RETS4R::ListingService.configurations = YAML.load_file(listing_service_config_file)
RETS4R::ListingService.env = ENV['RETS4RENV'] || 'development'

xml = ARGF

mapper = RETS4R::ListingMapper.new
RETS4R::Loader.load(xml) do |record|
attributes = mapper.map(record)
puts attributes.inspect
end

0 comments on commit f6376ea

Please sign in to comment.