Class: Cucumber::Ast::Table::Cells
- Includes:
- Enumerable
- 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.
254 255 256 |
# File 'lib/cucumber/ast/table.rb', line 254 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
252 253 254 |
# File 'lib/cucumber/ast/table.rb', line 252 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
278 279 280 |
# File 'lib/cucumber/ast/table.rb', line 278 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
258 259 260 261 262 263 |
# File 'lib/cucumber/ast/table.rb', line 258 def accept(visitor) each do |cell| visitor.visit_table_cell(cell) end nil end |
#dom_id ⇒ Object
286 287 288 |
# File 'lib/cucumber/ast/table.rb', line 286 def dom_id "row_#{line}" end |
#line ⇒ Object
282 283 284 |
# File 'lib/cucumber/ast/table.rb', line 282 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
270 271 272 |
# File 'lib/cucumber/ast/table.rb', line 270 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self).freeze end |
#to_sexp ⇒ Object
For testing only
266 267 268 |
# File 'lib/cucumber/ast/table.rb', line 266 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
274 275 276 |
# File 'lib/cucumber/ast/table.rb', line 274 def value(n) #:nodoc: self[n].value end |