Module: ObjectTable::ViewMethods

Extended by:
Forwardable
Includes:
Factory::SubFactory, TableMethods
Included in:
StaticView, View
Defined in:
lib/object_table/view_methods.rb

Constant Summary

Constants included from TableMethods

TableMethods::Util

Instance Attribute Summary

Attributes included from TableMethods

#R

Instance Method Summary collapse

Methods included from TableMethods

#==, #_get_sort_index, #apply, #clone, #each_row, #group_by, #initialize, #method_missing, #ncols, #respond_to?, #set_column, #sort_by, #where

Methods included from Stacking

process_stackable_grid, #stack, stack_segments

Methods included from Joining

copy_column, #join

Methods included from Printing

calc_column_widths, format_column, format_rows, format_section, #inspect, split_column_lines

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ObjectTable::TableMethods

Instance Method Details

#add_column(name, *args) ⇒ Object



27
28
29
30
# File 'lib/object_table/view_methods.rb', line 27

def add_column(name, *args)
  col = @parent.add_column(name, *args)
  ObjectTable::MaskedColumn.mask(col, indices)
end

#columnsObject



17
18
19
# File 'lib/object_table/view_methods.rb', line 17

def columns
  ObjectTable::BasicGrid[@parent.columns.map{|k, v| [k, ObjectTable::MaskedColumn.mask(v, indices)]}]
end

#get_column(name) ⇒ Object Also known as: []



21
22
23
24
# File 'lib/object_table/view_methods.rb', line 21

def get_column(name)
  col = @parent.get_column(name)
  ObjectTable::MaskedColumn.mask(col, indices) if col
end

#nrowsObject



13
14
15
# File 'lib/object_table/view_methods.rb', line 13

def nrows
  indices.length
end

#pop_column(name) ⇒ Object



32
33
34
35
# File 'lib/object_table/view_methods.rb', line 32

def pop_column(name)
  @parent.pop_column(name)
  super if @columns
end