Created
November 1, 2013 22:07
-
-
Save aarti/7272752 to your computer and use it in GitHub Desktop.
Mapping Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.parse_detail( rows ) | |
details = rows.map do |row| | |
detail = {} | |
[ | |
[:line_item, 0], | |
[:title, 1], | |
[:asin, 2], | |
[:units_sold, 3], | |
[:units_refunded, 4], | |
[:net_units_sold, 5], | |
[:net_units_borrowed, 6], | |
[:free_units_promo, 7], | |
[:free_units_price_match, 8], | |
].each do |dest_name, source_index| | |
detail[dest_name] = row[source_index] | |
end | |
detail | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment