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


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

def index
  @index
end

Instance Method Details

#examples_table(table, &descend) ⇒ Object


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

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

#examples_table_row(row, &_descend) ⇒ Object


765
766
767
768
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 765

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

#resultObject


770
771
772
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 770

def result
  @result ||= 0
end