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
- #matches_lines?(lines) ⇒ Boolean
- #status=(status) ⇒ 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.
256 257 258 |
# File 'lib/cucumber/ast/table.rb', line 256 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
254 255 256 |
# File 'lib/cucumber/ast/table.rb', line 254 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
284 285 286 |
# File 'lib/cucumber/ast/table.rb', line 284 def [](n) @cells[n] end |
#accept(visitor) ⇒ Object
264 265 266 267 268 269 |
# File 'lib/cucumber/ast/table.rb', line 264 def accept(visitor) each do |cell| visitor.visit_table_cell(cell) end nil end |
#dom_id ⇒ Object
292 293 294 |
# File 'lib/cucumber/ast/table.rb', line 292 def dom_id "row_#{line}" end |
#line ⇒ Object
288 289 290 |
# File 'lib/cucumber/ast/table.rb', line 288 def line @cells[0].line end |
#matches_lines?(lines) ⇒ Boolean
260 261 262 |
# File 'lib/cucumber/ast/table.rb', line 260 def matches_lines?(lines) lines.index(line) end |
#status=(status) ⇒ Object
296 297 298 299 300 |
# File 'lib/cucumber/ast/table.rb', line 296 def status=(status) each do |cell| cell.status = status end end |
#to_hash ⇒ Object
:nodoc:
276 277 278 |
# File 'lib/cucumber/ast/table.rb', line 276 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
#to_sexp ⇒ Object
For testing only
272 273 274 |
# File 'lib/cucumber/ast/table.rb', line 272 def to_sexp #:nodoc: [:row, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
280 281 282 |
# File 'lib/cucumber/ast/table.rb', line 280 def value(n) #:nodoc: self[n].value end |