Module: ObjectTable::ViewMethods

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

Instance Attribute Summary

Attributes included from TableMethods

#R

Instance Method Summary collapse

Methods included from TableChild

#__group_cls__, #__static_view_cls__, #__table_cls__, #__view_cls__

Methods included from TableMethods

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

Methods included from Printable

#_format_rows, #_format_section, calc_column_widths, get_printable_column, #inspect

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



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

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

#columnsObject



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

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

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



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

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

#nrowsObject



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

def nrows
  indices.length
end

#pop_column(name) ⇒ Object



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

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