Class: SolidusVolumePricing::Pricer
- Inherits:
-
Spree::Variant::PriceSelector
- Object
- Spree::Variant::PriceSelector
- SolidusVolumePricing::Pricer
- Defined in:
- app/models/solidus_volume_pricing/pricer.rb
Instance Attribute Summary collapse
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
- #earning_amount(pricing_options) ⇒ Object
- #earning_percent(pricing_options) ⇒ Object
- #price_for(pricing_options) ⇒ Object
Instance Attribute Details
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
5 6 7 |
# File 'app/models/solidus_volume_pricing/pricer.rb', line 5 def quantity @quantity end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'app/models/solidus_volume_pricing/pricer.rb', line 5 def user @user end |
Class Method Details
.pricing_options_class ⇒ Object
7 8 9 |
# File 'app/models/solidus_volume_pricing/pricer.rb', line 7 def self. SolidusVolumePricing::PricingOptions end |
Instance Method Details
#earning_amount(pricing_options) ⇒ Object
16 17 18 19 |
# File 'app/models/solidus_volume_pricing/pricer.rb', line 16 def earning_amount() () ::Spree::Money.new(computed_earning) end |
#earning_percent(pricing_options) ⇒ Object
21 22 23 24 |
# File 'app/models/solidus_volume_pricing/pricer.rb', line 21 def earning_percent() () computed_earning_percent.round end |
#price_for(pricing_options) ⇒ Object
11 12 13 14 |
# File 'app/models/solidus_volume_pricing/pricer.rb', line 11 def price_for() () ::Spree::Money.new(computed_price) end |