Class: Cucumber::Core::Ast::DataTable::Cells
- Inherits:
-
Object
- Object
- Cucumber::Core::Ast::DataTable::Cells
- Includes:
- Enumerable, Gherkin::Formatter::Escaping
- Defined in:
- lib/cucumber/core/ast/data_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
-
#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.
266 267 268 |
# File 'lib/cucumber/core/ast/data_table.rb', line 266 def initialize(table, cells) @table, @cells = table, cells end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
264 265 266 |
# File 'lib/cucumber/core/ast/data_table.rb', line 264 def exception @exception end |
Instance Method Details
#[](n) ⇒ Object
283 284 285 |
# File 'lib/cucumber/core/ast/data_table.rb', line 283 def [](n) @cells[n] end |
#line ⇒ Object
287 288 289 |
# File 'lib/cucumber/core/ast/data_table.rb', line 287 def line @cells[0].line end |
#to_hash ⇒ Object
:nodoc:
275 276 277 |
# File 'lib/cucumber/core/ast/data_table.rb', line 275 def to_hash #:nodoc: @to_hash ||= @table.to_hash(self) end |
#to_sexp ⇒ Object
For testing only
271 272 273 |
# File 'lib/cucumber/core/ast/data_table.rb', line 271 def to_sexp #:nodoc: [:row, line, *@cells.map{|cell| cell.to_sexp}] end |
#value(n) ⇒ Object
:nodoc:
279 280 281 |
# File 'lib/cucumber/core/ast/data_table.rb', line 279 def value(n) #:nodoc: self[n].value end |