class Gauge::Row
Holds a row of a table. @api public
Public Class Methods
Source
# File lib/table.rb, line 70 def initialize(columns, values) @values = values @columns = columns end
@api private
Public Instance Methods
Source
# 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
Gets the row cell. @param index Either cell index, or Column name. @return [string] value of the row cell @example
row[0] => 'value' row['column'] => 'value' row[i] => nil # when index is out of range