Class: Table

Inherits:
Array show all
Includes:
Enumerable
Defined in:
lib/quality_extensions/table.rb

Overview

A table is…

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Enumerable

#all_same?, #every, #gradiate, #grep_indexes, #grep_plus_offset, #grep_with_index, #grep_with_regexp_support_for_symbols, #group_by_and_map, #map_with_index, #map_with_index!, #max_by_value, #reject_with_index, #reject_with_index!, #select!, #select_from, #select_until, #select_until_last, #select_until_last_with_index, #select_until_with_index, #select_while, #select_while_with_index, #select_with_index, #select_with_index!

Methods inherited from Array

#after, #average, #before, #classify, #delete_if!, #expand_ranges, #extract_options!, #group_by, #ljust_columns, #ljust_columns!, #ljust_rows, #ljust_rows!, #mean, #rjust_columns, #rjust_columns!, #rjust_rows, #rjust_rows!, #select_if!, #select_if_with_index!, #shell_escape, #sum, #to_a_recursive, #to_query_string, #to_range_list

Constructor Details

#initialize(*args) ⇒ Table

Returns a new instance of Table.



68
69
70
71
72
# File 'lib/quality_extensions/table.rb', line 68

def initialize(*args)
  pp args
  @rows = super(args)
  #super(@rows = Array.new(*args))
end

Class Method Details

.[](*args) ⇒ Object



53
54
55
# File 'lib/quality_extensions/table.rb', line 53

def self.[](*args)
  Table.new(*args)
end

.columns(columns) ⇒ Object

Creates a table using columns as an array of column arrays.



63
64
# File 'lib/quality_extensions/table.rb', line 63

def self.columns(columns)
end

.rows(rows) ⇒ Object

See /usr/lib/ruby/1.8/matrix.rb Creates a table using rows as an array of row arrays.



59
60
# File 'lib/quality_extensions/table.rb', line 59

def self.rows(rows)
end

.superclassObject



66
# File 'lib/quality_extensions/table.rb', line 66

def self.superclass; Array; end

Instance Method Details

#+(other) ⇒ Object



74
75
76
# File 'lib/quality_extensions/table.rb', line 74

def +(other)
  # should work for tables of strings too
end