Class: Spree::ShippingCalculator

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

Instance Method Summary collapse

Methods inherited from Calculator

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

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Instance Method Details

#available?(_package) ⇒ Boolean

Returns:

  • (Boolean)


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

def available?(_package)
  true
end

#compute_package(_package) ⇒ Object

Raises:

  • (NotImplementedError)


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

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

#compute_shipment(_shipment) ⇒ Object

Raises:

  • (NotImplementedError)


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

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