Class: BooticCli::Commands::Orders::OrdersTable
- Inherits:
-
Object
- Object
- BooticCli::Commands::Orders::OrdersTable
- Defined in:
- lib/bootic_cli/commands/orders.rb
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(orders) ⇒ OrdersTable
constructor
A new instance of OrdersTable.
Constructor Details
#initialize(orders) ⇒ OrdersTable
Returns a new instance of OrdersTable.
9 10 11 |
# File 'lib/bootic_cli/commands/orders.rb', line 9 def initialize(orders) @orders = orders end |
Class Method Details
.call(orders) ⇒ Object
5 6 7 |
# File 'lib/bootic_cli/commands/orders.rb', line 5 def self.call(orders) new(orders).data end |
Instance Method Details
#data ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/bootic_cli/commands/orders.rb', line 13 def data data = [['status', 'updated', 'created', 'code', 'total', 'discount', 'payment', 'client']] data += orders.map do |order| [order.status, order.updated_on, order.created_on, order.code, order.total, discount_line(order), payment_line(order), order_contact_name(order)] end data end |