Class: Mensa::Table::Component

Inherits:
ApplicationComponent show all
Includes:
Mensa::TablesHelper
Defined in:
app/components/mensa/table/component.rb

Instance Attribute Summary collapse

Attributes inherited from ApplicationComponent

#original_view_context

Instance Method Summary collapse

Constructor Details

#initialize(table_name, config = {}, **options) ⇒ Component

Returns a new instance of Component.



11
12
13
14
15
# File 'app/components/mensa/table/component.rb', line 11

def initialize(table_name, config = {}, **options)
  @table = Mensa.for_name(table_name, config)
  @table.component = self
  @params = options[:params] || {}
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



9
10
11
# File 'app/components/mensa/table/component.rb', line 9

def params
  @params
end

#tableObject (readonly)

Returns the value of attribute table.



8
9
10
# File 'app/components/mensa/table/component.rb', line 8

def table
  @table
end