Class: SpreeCmCommissioner::PricingModels::PricingPreview
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::PricingModels::PricingPreview
- Defined in:
- lib/spree_cm_commissioner/pricing_models/pricing_preview.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item_total ⇒ Object
readonly
Returns the value of attribute item_total.
-
#pricing_adjustment_ids ⇒ Object
readonly
Returns the value of attribute pricing_adjustment_ids.
-
#pricing_adjustment_total ⇒ Object
readonly
Returns the value of attribute pricing_adjustment_total.
-
#pricing_adjustments ⇒ Object
readonly
Returns the value of attribute pricing_adjustments.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(id:, item_total:, total:, pricing_adjustment_total:, pricing_adjustments:) ⇒ PricingPreview
constructor
A new instance of PricingPreview.
Constructor Details
#initialize(id:, item_total:, total:, pricing_adjustment_total:, pricing_adjustments:) ⇒ PricingPreview
Returns a new instance of PricingPreview.
6 7 8 9 10 11 12 13 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 6 def initialize(id:, item_total:, total:, pricing_adjustment_total:, pricing_adjustments:) @id = id @item_total = item_total @total = total @pricing_adjustment_total = pricing_adjustment_total @pricing_adjustments = pricing_adjustments @pricing_adjustment_ids = pricing_adjustments.map(&:id) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 4 def id @id end |
#item_total ⇒ Object (readonly)
Returns the value of attribute item_total.
4 5 6 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 4 def item_total @item_total end |
#pricing_adjustment_ids ⇒ Object (readonly)
Returns the value of attribute pricing_adjustment_ids.
4 5 6 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 4 def pricing_adjustment_ids @pricing_adjustment_ids end |
#pricing_adjustment_total ⇒ Object (readonly)
Returns the value of attribute pricing_adjustment_total.
4 5 6 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 4 def pricing_adjustment_total @pricing_adjustment_total end |
#pricing_adjustments ⇒ Object (readonly)
Returns the value of attribute pricing_adjustments.
4 5 6 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 4 def pricing_adjustments @pricing_adjustments end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
4 5 6 |
# File 'lib/spree_cm_commissioner/pricing_models/pricing_preview.rb', line 4 def total @total end |