Module: SellObject::ClassMethods

Defined in:
lib/sell_object.rb

Instance Method Summary collapse

Instance Method Details

#sell_through(*engines) ⇒ Object

Raises:

  • (ArgumentError)


40
41
42
43
44
45
46
47
# File 'lib/sell_object.rb', line 40

def sell_through(*engines)
  raise ArgumentError.new('must pass at least one shopping engine') if engines.empty?
  engines.each do |engine|
    SellObject.validate_engine engine
  camelized_engine = engine.to_s.split('_').map {|w| w.capitalize}.join
    include eval("SellObject::#{camelized_engine}")
  end
end