Module: Cucumber::TreetopParser::Feature::Table2

Defined in:
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ar.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_cy.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_da.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_de.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_en.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_es.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_et.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_fr.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_id.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_it.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ja.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ko.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_lt.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_nl.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_no.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_pl.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_pt.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ro.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ru.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_se.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ro2.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_en-tx.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_zh-CN.rb,
lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_en-lol.rb

Instance Method Summary collapse

Instance Method Details

#bodyObject



708
709
710
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ar.rb', line 708

def body
  super.elements.map { |elt| elt.table_line }
end

#compile(feature) ⇒ Object



684
685
686
687
688
689
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ar.rb', line 684

def compile(feature)
  Feature.last_scenario.table_header = head.cell_values
  body.each do |table_line|
    feature.add_row_scenario(Feature.last_scenario, table_line.cell_values, table_line.line)
  end
end

#compile_examples(feature, scenario) ⇒ Object



691
692
693
694
695
696
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ar.rb', line 691

def compile_examples(feature, scenario)
  scenario.table_header = head.cell_values
  body.each do |table_line|
    feature.add_row_scenario_outline(scenario, table_line.cell_values, table_line.line)
  end
end

#matrixObject



698
699
700
701
702
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ar.rb', line 698

def matrix
  ([head] + body).map do |table_line|
    table_line.cell_values # We're losing the line - we'll get it back when we make our own class
  end
end

#to_argObject



704
705
706
# File 'lib/gems/cucumber-0.1.15/lib/cucumber/treetop_parser/feature_ar.rb', line 704

def to_arg
  Model::Table.new(matrix)
end