Class: Spree::PriceRule

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/price_rule.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionString

Returns the description of the price rule

Returns:

  • (String)


22
23
24
# File 'app/models/spree/price_rule.rb', line 22

def self.description
  ''
end

.human_nameString

Returns the human name of the price rule

Returns:

  • (String)


16
17
18
# File 'app/models/spree/price_rule.rb', line 16

def self.human_name
  name.demodulize.titleize
end

Instance Method Details

#applicable?(context) ⇒ Boolean

Returns true if the price rule is applicable to the context

Parameters:

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


10
11
12
# File 'app/models/spree/price_rule.rb', line 10

def applicable?(context)
  raise NotImplementedError, "#{self.class.name} must implement #applicable?"
end