Class: IGMarkets::CLI::Tables::PositionsTable

Inherits:
Table
  • Object
show all
Defined in:
lib/ig_markets/cli/tables/positions_table.rb

Overview

Helper class that prints out an array of Position instances in a table. Positions that share an EPIC can be aggregated into one row in the table if desired.

Instance Method Summary collapse

Methods inherited from Table

#lines, #to_s

Constructor Details

#initialize(models, options = {}) ⇒ PositionsTable

Returns a new instance of PositionsTable.



7
8
9
10
11
# File 'lib/ig_markets/cli/tables/positions_table.rb', line 7

def initialize(models, options = {})
  models = aggregated_positions(models) if options[:aggregate]

  super models, options
end