Module: ControllerHelper
- Includes:
- Informatics::Globals
- Included in:
- ApplicationHelper
- Defined in:
- lib/informatics/lib/informatics/controller_helper.rb
Instance Method Summary collapse
-
#add(type, link, options = nil) ⇒ Object
rubocop:todo Metrics/MethodLength, Metrics/AbcSize.
-
#logger ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/MethodLength.
Methods included from Informatics::Globals
#application, #application=, #defaults, #defaults=, #global_searchable_classes, #search_options
Instance Method Details
#add(type, link, options = nil) ⇒ Object
rubocop:todo Metrics/MethodLength, Metrics/AbcSize
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/informatics/lib/informatics/controller_helper.rb', line 14 def add(type, link, = nil) # rubocop:todo Metrics/CyclomaticComplexity o = Informatics::Support::Options.collect() l = Informatics::Support::Options.collect(link) case type when :menu @menu ||= Informatics::View::Menu::List.new @menu = add_link(@menu, l, o, ) when :back_menu @back_menu ||= Informatics::View::Menu::List.new @back_menu.add_item text: l.first_key, link: l.first_value when :about, :title # Replaces :title @about = link when :legend_option @legend = add_link(@legend, l, o, ) when :tab @tabs = Informatics::View::Tabs::List.new unless @tabs @tabs.add_item text: l.first_key, link: l.first_value end end |
#logger ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/MethodLength
37 38 39 |
# File 'lib/informatics/lib/informatics/controller_helper.rb', line 37 def logger Rails.logger end |