Class: ObjectTable::StaticView
- Inherits:
-
Object
- Object
- ObjectTable::StaticView
- Includes:
- ViewMethods
- Defined in:
- lib/object_table/static_view.rb
Direct Known Subclasses
Constant Summary
Constants included from TableMethods
Instance Attribute Summary collapse
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
Attributes included from TableMethods
Instance Method Summary collapse
- #add_column(name, *args) ⇒ Object
- #columns ⇒ Object
- #get_column(name) ⇒ Object
-
#initialize(parent, indices) ⇒ StaticView
constructor
A new instance of StaticView.
Methods included from ViewMethods
Methods included from TableMethods
#==, #_get_sort_index, #apply, #clone, #each_row, #group_by, #method_missing, #ncols, #nrows, #respond_to?, #set_column, #sort_by, #where
Methods included from Stacking
process_stackable_grid, #stack, stack_segments
Methods included from Joining
Methods included from Printing
calc_column_widths, format_column, format_rows, format_section, #inspect, split_column_lines
Constructor Details
#initialize(parent, indices) ⇒ StaticView
Returns a new instance of StaticView.
9 10 11 12 13 14 15 |
# File 'lib/object_table/static_view.rb', line 9 def initialize(parent, indices) super() @parent = parent @indices = indices @columns = ObjectTable::BasicGrid.new @fully_cached = false end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ObjectTable::TableMethods
Instance Attribute Details
#indices ⇒ Object (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
29 30 31 |
# File 'lib/object_table/static_view.rb', line 29 def add_column(name, *args) @columns[name] = super end |
#columns ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/object_table/static_view.rb', line 17 def columns unless @fully_cached @parent.columns.each_key{|k| get_column(k)} @fully_cached = true end @columns end |
#get_column(name) ⇒ Object
25 26 27 |
# File 'lib/object_table/static_view.rb', line 25 def get_column(name) @columns[name] ||= super end |