Class: Cucumber::MultilineArgument::DataTable::Cells
- Includes:
- Gherkin::Formatter::Escaping, Enumerable
- Defined in:
- lib/cucumber/multiline_argument/data_table.rb
Overview
Represents a row of cells or columns of cells
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #[](n) ⇒ Object
- #accept(visitor) ⇒ Object
- #dom_id ⇒ Object
- #each(&proc) ⇒ Object
-
#initialize(table, cells) ⇒ Cells
constructor
A new instance of Cells.
- #line ⇒ Object
-
#to_hash ⇒ Object
:nodoc:.
-
#to_sexp ⇒ Object
For testing only.
-
#value(n) ⇒ Object
:nodoc:.
Methods included from Gherkin::Formatter::Escaping
Constructor Details
#initialize(table, cells) ⇒ Cells
Returns a new instance of Cells.
647 648 649 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 647 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
645 646 647 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 645 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
672 673 674 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 672 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
651 652 653 654 655 656 657 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 651 def accept(visitor) return if Cucumber.wants_to_quit each do |cell| visitor.visit_table_cell(cell) end nil end |
#dom_id ⇒ Object
680 681 682 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 680 def dom_id "row_#{line}" end |
#each(&proc) ⇒ Object
684 685 686 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 684 def each(&proc) @cells.each(&proc) end |
#line ⇒ Object
676 677 678 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 676 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
664 665 666 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 664 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
#to_sexp ⇒ Object
For testing only
660 661 662 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 660 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
668 669 670 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 668 def value(n) #:nodoc: self[n].value end |