Class: SolidusVolumePricing::PricingOptions
- Inherits:
-
Spree::Variant::PricingOptions
- Object
- Spree::Variant::PricingOptions
- SolidusVolumePricing::PricingOptions
- Defined in:
- app/models/solidus_volume_pricing/pricing_options.rb
Instance Attribute Summary collapse
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PricingOptions
constructor
A new instance of PricingOptions.
Constructor Details
#initialize(options = {}) ⇒ PricingOptions
Returns a new instance of PricingOptions.
7 8 9 10 11 |
# File 'app/models/solidus_volume_pricing/pricing_options.rb', line 7 def initialize( = {}) super .except(:quantity, :user) @quantity = .delete(:quantity) @user = .delete(:user) end |
Instance Attribute Details
#quantity ⇒ Object
Returns the value of attribute quantity.
5 6 7 |
# File 'app/models/solidus_volume_pricing/pricing_options.rb', line 5 def quantity @quantity end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'app/models/solidus_volume_pricing/pricing_options.rb', line 5 def user @user end |
Class Method Details
.from_line_item(line_item) ⇒ Object
13 14 15 16 17 18 |
# File 'app/models/solidus_volume_pricing/pricing_options.rb', line 13 def self.from_line_item(line_item) = super(line_item) .quantity = line_item.quantity .user = line_item.order.user end |