Class: Spree::ShippingCalculator
- Inherits:
-
Calculator
- Object
- ActiveRecord::Base
- Base
- Calculator
- Spree::ShippingCalculator
- Defined in:
- app/models/spree/shipping_calculator.rb
Direct Known Subclasses
Calculator::Shipping::FlatPercentItemTotal, Calculator::Shipping::FlatRate, Calculator::Shipping::FlexiRate, Calculator::Shipping::PerItem, Calculator::Shipping::PriceSack
Instance Method Summary collapse
- #available?(package) ⇒ Boolean
- #compute_package(package) ⇒ Object
- #compute_shipment(shipment) ⇒ Object
Methods inherited from Calculator
calculators, #compute, description, #description, register, #to_s
Methods inherited from Base
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
12 13 14 |
# File 'app/models/spree/shipping_calculator.rb', line 12 def available?(package) true end |
#compute_package(package) ⇒ Object
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
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 |