Class: Spree::Stock::ShippingRateSelector
- Inherits:
-
Object
- Object
- Spree::Stock::ShippingRateSelector
- Defined in:
- app/models/spree/stock/shipping_rate_selector.rb
Instance Attribute Summary collapse
-
#shipping_rates ⇒ Object
readonly
Returns the value of attribute shipping_rates.
Instance Method Summary collapse
- #find_default ⇒ Object
-
#initialize(shipping_rates) ⇒ ShippingRateSelector
constructor
A new instance of ShippingRateSelector.
Constructor Details
#initialize(shipping_rates) ⇒ ShippingRateSelector
Returns a new instance of ShippingRateSelector.
8 9 10 |
# File 'app/models/spree/stock/shipping_rate_selector.rb', line 8 def initialize(shipping_rates) @shipping_rates = shipping_rates end |
Instance Attribute Details
#shipping_rates ⇒ Object (readonly)
Returns the value of attribute shipping_rates.
6 7 8 |
# File 'app/models/spree/stock/shipping_rate_selector.rb', line 6 def shipping_rates @shipping_rates end |
Instance Method Details
#find_default ⇒ Object
12 13 14 |
# File 'app/models/spree/stock/shipping_rate_selector.rb', line 12 def find_default shipping_rates.min_by(&:cost) end |