Class: Spree::ShippingCalculator

Inherits:
Calculator 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

Methods inherited from Base

page

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

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