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, #to_s

Methods inherited from Base

belongs_to_required_by_default, page, spree_base_scopes

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


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

def available?(_package)
  true
end

#compute_package(_package) ⇒ Object

Raises:

  • (NotImplementedError)

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

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

#compute_shipment(_shipment) ⇒ Object

Raises:

  • (NotImplementedError)

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

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