Skip to content

Instantly share code, notes, and snippets.

@coderdan
Created October 8, 2013 23:26
Show Gist options
  • Select an option

  • Save coderdan/6893557 to your computer and use it in GitHub Desktop.

Select an option

Save coderdan/6893557 to your computer and use it in GitHub Desktop.
class MyTransformer < Transformer::Base
transform do
CSV.foreach(options[:file]) do |row|
add_item(row)
end
end
end
@coderdan
Copy link
Author

coderdan commented Oct 8, 2013

trans = MyTransformer.new(:file => "foo.csv")
trans.perform

@coderdan
Copy link
Author

coderdan commented Oct 8, 2013

trans = MyTransformer.new(:file => "foo.csv", :mapper => my_mapper)
trans.perform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment