Module: Adva

Defined in:
lib/adva/engine.rb,
lib/adva.rb,
lib/adva/core.rb,
lib/adva/rack.rb,
lib/adva/view.rb,
lib/adva/testing.rb,
lib/adva/registry.rb,
lib/adva/responder.rb,
lib/adva/view/form.rb,
lib/adva/view/menu.rb,
lib/adva/view/tabs.rb,
lib/adva/controller.rb,
lib/adva/generators.rb,
lib/adva/tasks/core.rb,
lib/adva/rack/static.rb,
lib/adva/generators/app.rb,
lib/adva/testing/engine.rb,
lib/adva/view/form/tabs.rb,
lib/adva/view/menu/admin.rb,
lib/adva/view/menu/items.rb,
lib/adva/generators/engine.rb,
lib/adva/generators/gemfile.rb,
lib/adva/generators/install.rb,
lib/adva/responder/redirect.rb,
lib/adva/controller/references.rb,
lib/adva/controller/abstract_actions.rb,
lib/adva/controller/internal_redirect.rb

Overview

Internally redirects a request to another controller. This is used by the abstract_actions module.

Defined Under Namespace

Modules: Controller, Engine, Generators, Rack, Tasks, Testing, View Classes: Core, Registry, Responder

Class Method Summary collapse

Class Method Details

.engine(name) ⇒ Object


24
25
26
27
# File 'lib/adva.rb', line 24

def engine(name)
  name = "Adva::#{name.camelize}" unless name.to_s.starts_with?('Adva::')
  engines.detect { |engine| engine.name == name }
end

.engine?(name) ⇒ Boolean Also known as: installed?


33
34
35
# File 'lib/adva.rb', line 33

def engine?(name)
  engine_names.include?(name)
end

.engine_namesObject


29
30
31
# File 'lib/adva.rb', line 29

def engine_names
  @engine_names ||= engines.map { |constant| constant.name.split('::').last.underscore.to_sym }
end

.enginesObject


17
18
19
20
21
22
# File 'lib/adva.rb', line 17

def engines
  @engines ||= constants.map do |name|
    constant = const_get(name)
    constant if constant != Adva::Core && constant.is_a?(Class) && constant < ::Rails::Engine
  end.compact.sort { |lft, rgt| lft.name <=> rgt.name }.unshift(Adva::Core)
end