class Importer
Public Class Methods
new(importer_options = {})
click to toggle source
# File lib/getter_cyndi5/importer.rb, line 2 def initialize(importer_options = {}) @importer_options = importer_options end
Public Instance Methods
import(product)
click to toggle source
# File lib/getter_cyndi5/importer.rb, line 6 def import(product) { :item_code => product.attributes[:item_data].fetch(@importer_options.fetch(:itemcode_key), ''), :name => product.attributes[:name], :url => product.attributes[:url], :price_a => product.attributes[:prices].fetch(@importer_options.fetch(:price_a_key), 0.0), :price_b => product.attributes[:prices].fetch(@importer_options.fetch(:price_b_key), 0.0) } end