Class: SpreeAvataxOfficial::ItemPresenter
- Inherits:
-
Object
- Object
- SpreeAvataxOfficial::ItemPresenter
- Defined in:
- app/presenters/spree_avatax_official/item_presenter.rb
Instance Method Summary collapse
-
#initialize(item:, custom_quantity: nil, custom_amount: nil) ⇒ ItemPresenter
constructor
A new instance of ItemPresenter.
- #to_json ⇒ Object
Constructor Details
#initialize(item:, custom_quantity: nil, custom_amount: nil) ⇒ ItemPresenter
Returns a new instance of ItemPresenter.
3 4 5 6 7 |
# File 'app/presenters/spree_avatax_official/item_presenter.rb', line 3 def initialize(item:, custom_quantity: nil, custom_amount: nil) @item = item @custom_quantity = custom_quantity @custom_amount = custom_amount end |
Instance Method Details
#to_json ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/presenters/spree_avatax_official/item_presenter.rb', line 10 def to_json case item.class.name.demodulize when 'LineItem' shared_payload.merge(line_item_payload) else shared_payload end end |