table_print icon indicating copy to clipboard operation
table_print copied to clipboard

specify multiple columns in a single hash

Open arches opened this issue 9 years ago • 1 comments

For example when I do tp systems, :system => {:display_method => :name}, :epic => {:display_method => :xyz}

The second column will never be displayed. It is also not called it seems. I can specifiy any symbol, existing method or not. Only system column is displayed.

-@ostraaten

Make it possible to specify two columns within a single hash, instead of forcing you to add curly braces to turn each column into its own hash

arches avatar Jul 24 '14 20:07 arches

lol, should have looked at issues sooner, I just found this issue 😜

require 'table_print'
tp [{first: "Josh", last: "Cheek"}],
   :first,
   :last,
   # full:     -> u { "#{u[:first]} #{u[:last]}"}, # <-- uncommenting this causes username to be omitted
   username: -> u { "#{u[:first][0]}#{u[:last]}"[0, 8].downcase }

# >> FIRST | LAST  | USERNAME
# >> ------|-------|---------
# >> Josh  | Cheek | jcheek  

JoshCheek avatar Oct 05 '18 21:10 JoshCheek