lib/terminal-table/cell.rb in terminal-table-3.0.0 vs lib/terminal-table/cell.rb in terminal-table-3.0.1

- old
+ new

@@ -1,6 +1,6 @@ -require 'unicode/display_width/no_string_ext' +require 'unicode/display_width' module Terminal class Table class Cell ## @@ -78,9 +78,17 @@ padding = (colspan - 1) * @table.cell_spacing inner_width = (1..@colspan).to_a.inject(0) do |w, counter| w + @table.column_width(@index + counter - 1) end inner_width + padding + end + + def inspect + fields = %i[alignment colspan index value width].map do |name| + val = self.instance_variable_get('@'+name.to_s) + "@#{name}=#{val.inspect}" + end.join(', ') + return "#<#{self.class} #{fields}>" end end end end