class Cucumber::Tcl::DataTable

Wraps the Cucumber DataTable so that when passed through to tcl, its string representation is easy to parse into a tcl list.

Public Class Methods

new(original) click to toggle source
# File lib/cucumber/tcl/data_table.rb, line 7
def initialize(original)
  @raw = original.raw
end

Public Instance Methods

to_s() click to toggle source
# File lib/cucumber/tcl/data_table.rb, line 11
def to_s
  to_tcl_list(@raw.map { |row| to_tcl_list(row) })
end

Private Instance Methods

to_tcl_list(array) click to toggle source
# File lib/cucumber/tcl/data_table.rb, line 17
def to_tcl_list(array)
  array.map { |element| "{" + element + "}" }.join(" ")
end