Class: Mensa::Table::Component
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Mensa::Table::Component
- Includes:
- Mensa::TablesHelper
- Defined in:
- app/components/mensa/table/component.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Attributes inherited from ApplicationComponent
Instance Method Summary collapse
-
#initialize(table_name, params: {}, **options) ⇒ Component
constructor
A new instance of Component.
Methods included from ApplicationHelper
#method_missing, #respond_to_missing?
Constructor Details
#initialize(table_name, params: {}, **options) ⇒ Component
Returns a new instance of Component.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/mensa/table/component.rb', line 11 def initialize(table_name, params: {}, **) @params = params config = {params: params} view_lookup_table = Mensa.for_name(table_name, config) view = view_lookup_table.default_system_view table_config = (view&.config&.deep_transform_keys(&:to_sym) || {}).merge(config) @table = Mensa.for_name(table_name, table_config) @table.table_view = view @table.original_view_context = [:original_view_context] @table.component = self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mensa::ApplicationHelper
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
9 10 11 |
# File 'app/components/mensa/table/component.rb', line 9 def params @params end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
8 9 10 |
# File 'app/components/mensa/table/component.rb', line 8 def table @table end |