Class: Gauge::Row
- Inherits:
-
Object
- Object
- Gauge::Row
- Defined in:
- lib/table.rb
Overview
Holds a row of a table.
Instance Method Summary collapse
-
#[](index) ⇒ string
Gets the row cell.
-
#initialize(columns, values) ⇒ Row
constructor
private
A new instance of Row.
Constructor Details
#initialize(columns, values) ⇒ Row
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Row.
70 71 72 73 |
# File 'lib/table.rb', line 70 def initialize(columns, values) @values = values @columns = columns end |
Instance Method Details
#[](index) ⇒ string
Gets the row cell.
82 83 84 85 86 |
# File 'lib/table.rb', line 82 def [](index) return @values[index] if index.is_a?(Integer) columns_index = @columns.index(index) columns_index.nil? ? nil : @values[columns_index] end |