class Data_table
Public Class Methods
Source
# File lib/models/data_table/data_table.rb, line 7 def initialize(data) self.data = data end
constructor
Public Instance Methods
Source
# File lib/models/data_table/data_table.rb, line 17 def col_count if self.data.empty? return 0 end self.data[0].size end
column count
Source
# File lib/models/data_table/data_table.rb, line 25 def get(row, col) raise IndexError, "Row out of bounds" unless self.valid_row?(row) raise IndexError, "Column out of bounds" unless self.valid_col?(col) self.deep_dup(self.data[row][col]) end
get element
Source
# File lib/models/data_table/data_table.rb, line 12 def row_count self.data.size end
row count