class Trading::PriceTable
Public Class Methods
new()
click to toggle source
# File lib/trading/price_table.rb, line 7 def initialize @table = Terminal::Table.new headings: %w(Pair LastPrice) @table.align_column(0,:right) end
Public Instance Methods
format(pair)
click to toggle source
# File lib/trading/price_table.rb, line 12 def format(pair) row = [] row << Rainbow("#{pair['symbol']}").color(:green) row << Rainbow("#{pair['price']}").color(:green) @table << row end
print_to_console()
click to toggle source
# File lib/trading/price_table.rb, line 19 def print_to_console puts @table.to_s end