Class: Workarea::Storefront::LegacyOrderViewModel

Inherits:
ApplicationViewModel
  • Object
show all
Defined in:
app/view_models/workarea/storefront/legacy_order_view_model.rb

Instance Method Summary collapse

Instance Method Details

#canceled_itemsObject



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_statusObject



4
5
6
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 4

def fulfillment_status
  status
end

#itemsObject



12
13
14
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 12

def items
  @items ||= LegacyOrderItemViewModel.wrap(model.items)
end

#packagesObject



28
29
30
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 28

def packages
  []
end

#pending_itemsObject



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

#refundsObject



32
33
34
# File 'app/view_models/workarea/storefront/legacy_order_view_model.rb', line 32

def refunds
  []
end

#requires_shipping?Boolean

Returns:

  • (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_itemsObject



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