Getting this error:
(`+': no implicit conversion of Integer into String (TypeError))
This is the line calling it:
print "\tsize "+(package["size"] == nil ? "" : package["size"])+"\n";
When package["size"] is not nil, its returning and integer and you're trying to concatenate it into a string, and its not doing implicite typcasting of values
Here are a few ways you can get it to work
Solution 1.
"\tsize " + package['size'].to_s + "\n";
Solution 2.
"\tsize #{package['size'].to_s}\n";
"\tsize " + (package['size']).to_s + "\n" directly?.to_s, it's implicit.
package["size"]is an Integer. Change it topackage["size"].to_sor use string interpolation.