Class: Workarea::Storefront::LegacyOrderViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Storefront::LegacyOrderViewModel
- Defined in:
- app/view_models/workarea/storefront/legacy_order_view_model.rb
Instance Method Summary collapse
- #canceled_items ⇒ Object
- #fulfillment_status ⇒ Object
- #items ⇒ Object
- #packages ⇒ Object
- #pending_items ⇒ Object
- #refunds ⇒ Object
- #requires_shipping? ⇒ Boolean
- #shipped_items ⇒ Object
Instance Method Details
#canceled_items ⇒ Object
24 25 26 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 24 def canceled_items items.select { |i| i.status == 'canceled' } end |
#fulfillment_status ⇒ Object
4 5 6 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 4 def fulfillment_status status end |
#items ⇒ Object
12 13 14 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 12 def items @items ||= LegacyOrderItemViewModel.wrap(model.items) end |
#packages ⇒ Object
28 29 30 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 28 def packages [] end |
#pending_items ⇒ Object
16 17 18 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 16 def pending_items items.select { |i| i.status == 'pending' } end |
#refunds ⇒ Object
32 33 34 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 32 def refunds [] end |
#requires_shipping? ⇒ Boolean
8 9 10 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 8 def requires_shipping? shipping_address.present? end |
#shipped_items ⇒ Object
20 21 22 |
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 20 def shipped_items items.select { |i| i.status == 'shipped' } end |