Class: Cucumber::Formatter::LegacyApi::Adapter::ExamplesTablePrinter::LegacyTable::FindMaxWidth

Inherits:
Struct
  • Object
show all
Includes:
Gherkin::Formatter::Escaping
Defined in:
lib/cucumber/formatter/legacy_api/adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gherkin::Formatter::Escaping

#escape_cell

Instance Attribute Details

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



745
746
747
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 745

def index
  @index
end

Instance Method Details

#examples_table(table, &descend) ⇒ Object



748
749
750
751
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 748

def examples_table(table, &descend)
  @result = char_length_of(table.header.values[index])
  descend.call(self)
end

#examples_table_row(row, &descend) ⇒ Object



753
754
755
756
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 753

def examples_table_row(row, &descend)
  width = char_length_of(row.values[index])
  @result = width if width > result
end

#resultObject



758
759
760
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 758

def result
  @result ||= 0
end