Class: Cucumber::MultilineArgument::DataTable::Cells
- Includes:
- Enumerable, Gherkin::Formatter::Escaping
- 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:.
Constructor Details
#initialize(table, cells) ⇒ Cells
Returns a new instance of Cells.
634 635 636 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 634 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
632 633 634 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 632 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
659 660 661 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 659 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
638 639 640 641 642 643 644 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 638 def accept(visitor) return if Cucumber.wants_to_quit each do |cell| visitor.visit_table_cell(cell) end nil end |
#dom_id ⇒ Object
667 668 669 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 667 def dom_id "row_#{line}" end |
#each(&proc) ⇒ Object
671 672 673 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 671 def each(&proc) @cells.each(&proc) end |
#line ⇒ Object
663 664 665 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 663 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
651 652 653 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 651 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
#to_sexp ⇒ Object
For testing only
647 648 649 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 647 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
655 656 657 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 655 def value(n) #:nodoc: self[n].value end |