Module: RightnowOms::ActsAsCartable

Defined in:
lib/rightnow_oms/acts_as_cartable.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) acts_as_cartable(opts = { name: :name, price: :price })



7
8
9
10
11
12
13
14
# File 'lib/rightnow_oms/acts_as_cartable.rb', line 7

def acts_as_cartable(opts = { name: :name, price: :price })
  cartable_config.update(opts) if opts.is_a? Hash

  class_eval do
    include RightnowOms::ActsAsCartable::InstanceMethods
    extend  RightnowOms::ActsAsCartable::ClassMethods
  end
end

- (Boolean) acts_as_cartable?



3
4
5
# File 'lib/rightnow_oms/acts_as_cartable.rb', line 3

def acts_as_cartable?
  false
end

- (Object) cartable_config



16
17
18
# File 'lib/rightnow_oms/acts_as_cartable.rb', line 16

def cartable_config
  @cartable_config ||= { name: :name, price: :price }
end