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

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



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

#acts_as_cartable?Boolean

Returns:

  • (Boolean)


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

def acts_as_cartable?
  false
end

#cartable_configObject



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

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