Class: Spree::Stock::Estimator
- Inherits:
-
Object
- Object
- Spree::Stock::Estimator
- Includes:
- VatPriceCalculation
- Defined in:
- app/models/spree/stock/estimator.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
-
#initialize(order) ⇒ Estimator
constructor
A new instance of Estimator.
- #shipping_rates(package, shipping_method_filter = ShippingMethod::DISPLAY_ON_FRONT_END) ⇒ Object
Methods included from VatPriceCalculation
Constructor Details
#initialize(order) ⇒ Estimator
Returns a new instance of Estimator.
8 9 10 11 |
# File 'app/models/spree/stock/estimator.rb', line 8 def initialize(order) @order = order @currency = order.currency end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
6 7 8 |
# File 'app/models/spree/stock/estimator.rb', line 6 def currency @currency end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
6 7 8 |
# File 'app/models/spree/stock/estimator.rb', line 6 def order @order end |
Instance Method Details
#shipping_rates(package, shipping_method_filter = ShippingMethod::DISPLAY_ON_FRONT_END) ⇒ Object
13 14 15 16 17 |
# File 'app/models/spree/stock/estimator.rb', line 13 def shipping_rates(package, shipping_method_filter = ShippingMethod::DISPLAY_ON_FRONT_END) rates = calculate_shipping_rates(package, shipping_method_filter) choose_default_shipping_rate(rates) sort_shipping_rates(rates) end |