Class: Workarea::Pricing::Discount::InternationalItemProxy
- Inherits:
-
Object
- Object
- Workarea::Pricing::Discount::InternationalItemProxy
- Defined in:
- app/models/workarea/pricing/discount/international_item_proxy.rb
Instance Attribute Summary collapse
-
#order_item ⇒ Object
readonly
Returns the value of attribute order_item.
Instance Method Summary collapse
-
#adjust_pricing(options = {}) ⇒ self
Adds an international price adjustment to the item.
- #current_unit_price ⇒ Object
-
#initialize(order_item) ⇒ InternationalItemProxy
constructor
A new instance of InternationalItemProxy.
Constructor Details
#initialize(order_item) ⇒ InternationalItemProxy
Returns a new instance of InternationalItemProxy.
8 9 10 |
# File 'app/models/workarea/pricing/discount/international_item_proxy.rb', line 8 def initialize(order_item) @order_item = order_item end |
Instance Attribute Details
#order_item ⇒ Object (readonly)
Returns the value of attribute order_item.
5 6 7 |
# File 'app/models/workarea/pricing/discount/international_item_proxy.rb', line 5 def order_item @order_item end |
Instance Method Details
#adjust_pricing(options = {}) ⇒ self
Adds an international price adjustment to the item. Does not persist.
21 22 23 |
# File 'app/models/workarea/pricing/discount/international_item_proxy.rb', line 21 def adjust_pricing( = {}) international_price_adjustments.build() end |
#current_unit_price ⇒ Object
12 13 14 15 |
# File 'app/models/workarea/pricing/discount/international_item_proxy.rb', line 12 def current_unit_price return 0.to_m(order.currency) if international_price_adjustments.blank? international_price_adjustments.adjusting('item').map(&:unit).sum.to_m end |