Class: Cucumber::Ast::OutlineTable

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

Defined Under Namespace

Classes: ExampleCells

Constant Summary

Constants inherited from Table

Table::NULL_CONVERSIONS

Instance Attribute Summary

Attributes inherited from Table

#file

Instance Method Summary collapse

Methods inherited from Table

#arguments_replaced, #cells_rows, default_arg_name, #dup, #each_cells_row, #hashes, #header_cell, #index, #map_column!, #map_headers, #matches_lines?, #raw, #rows, #rows_hash, #status=, #to_hash, #to_sexp, #transpose, #verify_column, #verify_table_width

Constructor Details

#initialize(raw, scenario_outline) ⇒ OutlineTable

Returns a new instance of OutlineTable.



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

def initialize(raw, scenario_outline)
  super(raw)
  @scenario_outline = scenario_outline
  @cells_class = ExampleCells
  
  cells_rows.each do |cells|
    cells.create_step_invocations!(scenario_outline)
  end
end

Instance Method Details

#accept(visitor) ⇒ Object



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

def accept(visitor)
  cells_rows.each_with_index do |row, n|
    if n == 0 || matches?(visitor, row)
      visitor.visit_table_row(row)
    end
  end
  nil
end

#descend?(visitor) ⇒ Boolean

Returns:

  • (Boolean)


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

def descend?(visitor)
  cells_rows.detect{|cells_row| cells_row.descend?(visitor)}
end

#matches?(visitor, cells) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
# File 'lib/cucumber/ast/outline_table.rb', line 27

def matches?(visitor, cells)
  @scenario_outline.matches_tags_and_name?(visitor) &&
  (visitor.matches_lines?(cells) || visitor.matches_lines?(@scenario_outline))
end

#skip_invoke!Object



32
33
34
35
36
# File 'lib/cucumber/ast/outline_table.rb', line 32

def skip_invoke!
  cells_rows.each do |cells|
    cells.skip_invoke!
  end
end