Class: Cucumber::MultilineArgument::DataTable::Cells
- Inherits:
-
Object
- Object
- 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.
525 526 527 528 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 525 def initialize(table, cells) @table = table @cells = cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
523 524 525 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 523 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
552 553 554 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 552 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
530 531 532 533 534 535 536 537 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 530 def accept(visitor) return if Cucumber.wants_to_quit each do |cell| visitor.visit_table_cell(cell) end nil end |
#dom_id ⇒ Object
560 561 562 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 560 def dom_id "row_#{line}" end |
#each(&proc) ⇒ Object
564 565 566 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 564 def each(&proc) @cells.each(&proc) end |
#line ⇒ Object
556 557 558 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 556 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
544 545 546 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 544 def to_hash # :nodoc: @to_hash ||= @table.cells_to_hash(self) end |
#to_sexp ⇒ Object
For testing only
540 541 542 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 540 def to_sexp # :nodoc: [:row, line, *@cells.map(&:to_sexp)] end |
#value(n) ⇒ Object
:nodoc:
548 549 550 |
# File 'lib/cucumber/multiline_argument/data_table.rb', line 548 def value(n) # :nodoc: self[n].value end |