Class: Cucumber::Ast::Table::Cells
- Includes:
- Enumerable, Gherkin::Formatter::Escaping
- Defined in:
- lib/cucumber/ast/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
-
#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
permalink #initialize(table, cells) ⇒ Cells
Returns a new instance of Cells.
599 600 601 |
# File 'lib/cucumber/ast/table.rb', line 599 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
Instance Method Details
permalink #[](n) ⇒ Object
[View source]
624 625 626 |
# File 'lib/cucumber/ast/table.rb', line 624 def [](n) @cells[n] end |
permalink #accept(visitor) ⇒ Object
[View source]
603 604 605 606 607 608 609 |
# File 'lib/cucumber/ast/table.rb', line 603 def accept(visitor) return if Cucumber.wants_to_quit each do |cell| visitor.visit_table_cell(cell) end nil end |
permalink #dom_id ⇒ Object
[View source]
632 633 634 |
# File 'lib/cucumber/ast/table.rb', line 632 def dom_id "row_#{line}" end |
permalink #line ⇒ Object
[View source]
628 629 630 |
# File 'lib/cucumber/ast/table.rb', line 628 def line @cells[0].line end |
permalink #to_hash ⇒ Object
:nodoc:
616 617 618 |
# File 'lib/cucumber/ast/table.rb', line 616 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
permalink #to_sexp ⇒ Object
For testing only
612 613 614 |
# File 'lib/cucumber/ast/table.rb', line 612 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
permalink #value(n) ⇒ Object
:nodoc:
620 621 622 |
# File 'lib/cucumber/ast/table.rb', line 620 def value(n) #:nodoc: self[n].value end |