Module: InheritedViews::TableBuilder

Included in:
Base
Defined in:
lib/inherited_views/table_builder.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
# File 'lib/inherited_views/table_builder.rb', line 4

def self.included(base)
  base.extend ClassMethods
  base.class_inheritable_accessor :table_config
  base.table_config = {}
  base.send :helper_method, :index_table_columns
end

Instance Method Details

#index_table_columnsObject



15
16
17
# File 'lib/inherited_views/table_builder.rb', line 15

def index_table_columns
  table_config[:columns] || self.class.default_table_columns
end

#table_configObject



11
12
13
# File 'lib/inherited_views/table_builder.rb', line 11

def table_config
  self.class.table_config
end