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
#initialize(table, cells) ⇒ Cells
Returns a new instance of Cells.
594 595 596 |
# File 'lib/cucumber/ast/table.rb', line 594 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
592 593 594 |
# File 'lib/cucumber/ast/table.rb', line 592 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
619 620 621 |
# File 'lib/cucumber/ast/table.rb', line 619 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
598 599 600 601 602 603 604 |
# File 'lib/cucumber/ast/table.rb', line 598 def accept(visitor) return if Cucumber.wants_to_quit each do |cell| visitor.visit_table_cell(cell) end nil end |
#dom_id ⇒ Object
627 628 629 |
# File 'lib/cucumber/ast/table.rb', line 627 def dom_id "row_#{line}" end |
#line ⇒ Object
623 624 625 |
# File 'lib/cucumber/ast/table.rb', line 623 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
611 612 613 |
# File 'lib/cucumber/ast/table.rb', line 611 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
#to_sexp ⇒ Object
For testing only
607 608 609 |
# File 'lib/cucumber/ast/table.rb', line 607 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
615 616 617 |
# File 'lib/cucumber/ast/table.rb', line 615 def value(n) #:nodoc: self[n].value end |