Class: Spree::ShippingCalculator

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

Instance Method Summary collapse

Methods inherited from Calculator

calculators, #compute, description, #description, register, #to_s

Instance Method Details

#available?(package) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/models/spree/shipping_calculator.rb', line 12

def available?(package)
  true
end

#compute_package(package) ⇒ Object

Raises:

  • (NotImplementedError)


8
9
10
# File 'app/models/spree/shipping_calculator.rb', line 8

def compute_package(package)
  raise NotImplementedError, "Please implement 'compute_package(package)' in your calculator: #{self.class.name}"
end

#compute_shipment(shipment) ⇒ Object

Raises:

  • (NotImplementedError)


4
5
6
# File 'app/models/spree/shipping_calculator.rb', line 4

def compute_shipment(shipment)
  raise NotImplementedError, "Please implement 'compute_shipment(shipment)' in your calculator: #{self.class.name}"
end