Class: Spree::Adjustable::Adjuster::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/adjustable/adjuster/base.rb

Direct Known Subclasses

Promotion, Tax

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adjustable, totals) ⇒ Base

Returns a new instance of Base.



9
10
11
12
# File 'app/models/spree/adjustable/adjuster/base.rb', line 9

def initialize(adjustable, totals)
  @adjustable = adjustable
  @totals = totals
end

Class Method Details

.adjust(adjustable, totals) ⇒ Object



5
6
7
# File 'app/models/spree/adjustable/adjuster/base.rb', line 5

def self.adjust(adjustable, totals)
  new(adjustable, totals).update
end

Instance Method Details

#updateObject

Raises:

  • (NotImplementedError)


14
15
16
# File 'app/models/spree/adjustable/adjuster/base.rb', line 14

def update
  raise NotImplementedError, "Please implement 'update' in your adjuster: #{self.class.name}"
end