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

Instance Attribute Details

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



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

def index
  @index
end

Instance Method Details

#examples_table(table, &descend) ⇒ Object



750
751
752
753
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 750

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

#examples_table_row(row, &descend) ⇒ Object



755
756
757
758
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 755

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

#resultObject



760
761
762
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 760

def result
  @result ||= 0
end