class PT::DataTable

Public Class Methods

fields() click to toggle source
# File lib/pt/data_table.rb, line 44
def self.fields
  []
end
headers() click to toggle source
# File lib/pt/data_table.rb, line 48
def self.headers
  []
end
new(dataset, title=nil) click to toggle source
# File lib/pt/data_table.rb, line 10
def initialize(dataset, title=nil)
  @title = title
  @rows = dataset.map{ |row| DataRow.new(row, dataset) }
end

Public Instance Methods

[](pos) click to toggle source
# File lib/pt/data_table.rb, line 35
def [](pos)
  pos = pos.to_i
  (pos < 1 || pos > @rows.length) ? nil : @rows[pos-1].record
end
length() click to toggle source
# File lib/pt/data_table.rb, line 40
def length
  @rows.length
end
print(config={}) click to toggle source