table_print
table_print copied to clipboard
FrozenError when using tp
trafficstars
- ruby 2.7.4 via RVM
- gem install table_print 1.5.7 and pry 0.14.1
pry [1] pry(main)> require 'table_print' => true [2] pry(main)> foo = {'bar'=> 'baz', 'bat'=> 'bit'} => {"bar"=>"baz", "bat"=>"bit"} [3] pry(main)> tp foo FrozenError: can't modify frozen String: "bar" from /Users/nik/.rvm/gems/ruby-2.7.4/gems/table_print-1.5.7/lib/table_print/fingerprinter.rb:44:in `clear'
Perhaps I am doing something incorrectly?
table_print is designed to print an array of hashes, so should be:
foo = [{'bar'=> 'baz', 'bat'=> 'bit'}]