table_print icon indicating copy to clipboard operation
table_print copied to clipboard

FrozenError when using tp

Open nikgregory opened this issue 4 years ago • 1 comments
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?

nikgregory avatar Sep 08 '21 20:09 nikgregory

table_print is designed to print an array of hashes, so should be:

foo = [{'bar'=> 'baz', 'bat'=> 'bit'}]

shaicoleman avatar Apr 21 '23 10:04 shaicoleman