Class: Lucid::AST::OutlineTable

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

Overview

:nodoc:

Defined Under Namespace

Classes: ExampleRow

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, #cell_matrix, #cells_rows, #col_width, #column_names, default_arg_name, #diff!, #dup, #each_cells_row, #has_text?, #hashes, #header_cell, #headers, #index, #map_column!, #map_headers, #map_headers!, #match, parse, #raw, #rows, #rows_hash, #to_hash, #to_s, #to_sexp, #to_step_definition_arg, #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
# File 'lib/lucid/ast/outline_table.rb', line 4

def initialize(raw, scenario_outline)
  super(raw)
  @scenario_outline = scenario_outline
  @cells_class = ExampleRow
  example_rows.each do |example_row|
    example_row.create_step_invocations!(scenario_outline)
  end
end

Instance Method Details

#accept(visitor) ⇒ Object



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

def accept(visitor)
  visitor.visit_outline_table(self) do
    cells_rows.each do |row|
      row.accept(visitor)
    end
  end
  nil
end

#accept_hook?(hook) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/lucid/ast/outline_table.rb', line 22

def accept_hook?(hook)
  @scenario_outline.accept_hook?(hook)
end

#example_rowsObject



40
41
42
# File 'lib/lucid/ast/outline_table.rb', line 40

def example_rows
  cells_rows[1..-1]
end

#languageObject



48
49
50
# File 'lib/lucid/ast/outline_table.rb', line 48

def language
  @scenario_outline.language
end

#skip_invoke!Object



34
35
36
37
38
# File 'lib/lucid/ast/outline_table.rb', line 34

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

#source_tag_namesObject



30
31
32
# File 'lib/lucid/ast/outline_table.rb', line 30

def source_tag_names
  source_tags.map { |tag| tag.name }
end

#source_tagsObject



26
27
28
# File 'lib/lucid/ast/outline_table.rb', line 26

def source_tags
  @scenario_outline.source_tags
end

#visit_scenario_name(visitor, row) ⇒ Object



44
45
46
# File 'lib/lucid/ast/outline_table.rb', line 44

def visit_scenario_name(visitor, row)
  @scenario_outline.visit_scenario_name(visitor, row)
end