Module: Mensa

Extended by:
Configurable
Defined in:
app/components/mensa/view/component.rb,
lib/mensa.rb,
lib/mensa/engine.rb,
lib/mensa/version.rb,
app/tables/mensa/row.rb,
app/tables/mensa/base.rb,
app/tables/mensa/cell.rb,
app/tables/mensa/scope.rb,
app/tables/mensa/action.rb,
app/tables/mensa/column.rb,
app/tables/mensa/filter.rb,
lib/mensa/configuration.rb,
app/jobs/mensa/export_job.rb,
app/models/mensa/table_view.rb,
app/jobs/mensa/application_job.rb,
app/helpers/mensa/tables_helper.rb,
app/tables/mensa/config_readers.rb,
app/components/mensa/cell/component.rb,
app/models/mensa/application_record.rb,
app/components/mensa/table/component.rb,
app/components/mensa/views/component.rb,
app/helpers/mensa/application_helper.rb,
app/components/mensa/header/component.rb,
app/components/mensa/search/component.rb,
app/components/mensa/filters/component.rb,
lib/generators/mensa/install_generator.rb,
app/controllers/mensa/tables_controller.rb,
app/components/mensa/table_row/component.rb,
app/components/mensa/add_filter/component.rb,
app/components/mensa/row_action/component.rb,
app/components/mensa/application_component.rb,
app/components/mensa/control_bar/component.rb,
app/controllers/mensa/application_controller.rb,
lib/generators/mensa/tailwind_config_generator.rb,
app/controllers/mensa/tables/filters_controller.rb

Overview

Presents a single table-view, also in use when just one table is in view

Defined Under Namespace

Modules: AddFilter, ApplicationHelper, Config, ConfigReaders, Configurable, ControlBar, Filters, Generators, Header, Options, RowAction, Scope, Search, Table, TableRow, Tables, TablesHelper, View, Views Classes: Action, ApplicationComponent, ApplicationController, ApplicationJob, ApplicationRecord, Base, Cell, Column, Configuration, Engine, ExportJob, Filter, InstallGenerator, Row, TableView, TablesController

Constant Summary collapse

VERSION =
"0.1.10"

Instance Attribute Summary

Attributes included from Configurable

#config

Class Method Summary collapse

Methods included from Configurable

configure, reset_config!

Class Method Details

.class_for_name(name) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/mensa.rb', line 16

def class_for_name(name)
  class_name = "#{name}_table".camelcase
  unless class_name.safe_constantize
    module_class_name = name.to_s.split('_', 2).map(&:camelcase).join('::') + 'Table'
    class_name = module_class_name if module_class_name.safe_constantize
  end
  Kernel.const_get("::#{class_name}")
rescue NameError
  raise NotImplementedError, "No '#{name}' table defined."
end

.for_name(name, config = {}) ⇒ Object



10
11
12
13
14
# File 'lib/mensa.rb', line 10

def for_name(name, config = {})
  instance = class_for_name(name).new(config)
  instance.name = name
  instance
end