Class: Cucumber::Ast::OutlineTable

Inherits:
Table show all
Defined in:
lib/cucumber/ast/outline_table.rb

Defined Under Namespace

Classes: ExampleCells

Instance Attribute Summary

Attributes inherited from Table

#file

Instance Method Summary collapse

Methods inherited from Table

#arguments_replaced, #at_lines?, #hashes, #index, #raw, #to_hash, #to_sexp

Constructor Details

#initialize(raw, scenario_outline) ⇒ OutlineTable

Returns a new instance of OutlineTable.



4
5
6
7
8
# File 'lib/cucumber/ast/outline_table.rb', line 4

def initialize(raw, scenario_outline)
  super(raw)
  @scenario_outline = scenario_outline
  @cells_class = ExampleCells
end

Instance Method Details

#accept(visitor, status) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cucumber/ast/outline_table.rb', line 10

def accept(visitor, status)
  rows.each_with_index do |row, n|
    should_visit = n == 0 || 
      row.at_lines?(visitor.current_feature_lines) ||
      @scenario_outline.at_header_or_step_lines?(visitor.current_feature_lines)

    if should_visit
      visitor.visit_table_row(row, status)
    end
  end
  nil
end

#execute_row(cells, visitor, &proc) ⇒ Object



23
24
25
# File 'lib/cucumber/ast/outline_table.rb', line 23

def execute_row(cells, visitor, &proc)
  @scenario_outline.execute_row(cells, visitor, &proc)
end