Class: ObjectTable::StaticView

Inherits:
Object
  • Object
show all
Includes:
ViewMethods
Defined in:
lib/object_table/static_view.rb

Direct Known Subclasses

Group

Instance Attribute Summary collapse

Attributes included from TableMethods

#R

Instance Method Summary collapse

Methods included from ViewMethods

#pop_column

Methods included from TableChild

#__group_cls__, #__static_view_cls__, #__table_cls__, #__view_cls__

Methods included from TableMethods

#==, #_get_sort_index, #apply, #clone, #colnames, #group_by, #method_missing, #ncols, #nrows, #pop_column, #respond_to?, #set_column, #sort_by, #where

Methods included from Printable

get_printable_column, get_printable_line_numbers, #inspect

Constructor Details

#initialize(parent, indices) ⇒ StaticView

Returns a new instance of StaticView.


9
10
11
12
13
14
# File 'lib/object_table/static_view.rb', line 9

def initialize(parent, indices)
  super()
  @parent = parent
  @indices = indices
  columns
end

Dynamic Method Handling

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

Instance Attribute Details

#indicesObject (readonly)

Returns the value of attribute indices.


7
8
9
# File 'lib/object_table/static_view.rb', line 7

def indices
  @indices
end

Instance Method Details

#add_column(name, *args) ⇒ Object


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

def add_column(name, *args)
  @columns[name] = super
end

#columnsObject


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

def columns
  @columns ||= super
end