Class: Lucid::AST::Table::Cells
- Includes:
- Enumerable, Gherkin::Formatter::Escaping
- Defined in:
- lib/lucid/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.
628 629 630 |
# File 'lib/lucid/ast/table.rb', line 628 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
626 627 628 |
# File 'lib/lucid/ast/table.rb', line 626 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
654 655 656 |
# File 'lib/lucid/ast/table.rb', line 654 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
632 633 634 635 636 637 638 639 |
# File 'lib/lucid/ast/table.rb', line 632 def accept(visitor) visitor.visit_table_row(self) do each do |cell| cell.accept(visitor) end end nil end |
#dom_id ⇒ Object
662 663 664 |
# File 'lib/lucid/ast/table.rb', line 662 def dom_id "row_#{line}" end |
#line ⇒ Object
658 659 660 |
# File 'lib/lucid/ast/table.rb', line 658 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
646 647 648 |
# File 'lib/lucid/ast/table.rb', line 646 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
#to_sexp ⇒ Object
For testing only
642 643 644 |
# File 'lib/lucid/ast/table.rb', line 642 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
650 651 652 |
# File 'lib/lucid/ast/table.rb', line 650 def value(n) #:nodoc: self[n].value end |