We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to separate rows by differ type. portfolio_table << :separator is not working properly inside each-block.
portfolio_table << :separator
portfolio_table << :separator << row_data(item) is not working properly also.
portfolio_table << :separator << row_data(item)
def portfolio_table @portfolio_table ||= TTY::Table.new( header: %w[Type Name Amount Avg.\ price Yield Yield\ %] ) end prev_type = positions.first[:instrumentType] positions.each do |item| portfolio_table << :separator if item[:instrumentType] != prev_type portfolio_table << row_data(item) prev_type = item[:instrumentType] end puts portfolio_table.render(:ascii, padding: [0, 1, 0, 1])
+--------- | Type | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK +--------- | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK | STOCK | BOND | ETF | ETF | ETF | ETF | ETF | ETF | CURRENCY | CURRENCY +----------
Type ------ Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock Stock ------ Bond ------ Etf Etf Etf Etf Etf Etf ------ Currency Currency
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to separate rows by differ type.
portfolio_table << :separator
is not working properly inside each-block.portfolio_table << :separator << row_data(item)
is not working properly also.Steps to reproduce the problem
Actual behaviour
Expected behaviour
Environment
The text was updated successfully, but these errors were encountered: