Module: Hanami::Controller
- Includes:
- Utils::ClassAttribute
- Defined in:
- gems/gems/hanami-controller-1.3.1/lib/hanami/controller.rb,
gems/gems/hanami-controller-1.3.1/lib/hanami/action/exposable/guard.rb,
gems/gems/hanami-controller-1.3.1/lib/hanami/controller/error.rb,
gems/gems/hanami-controller-1.3.1/lib/hanami/controller/version.rb,
gems/gems/hanami-controller-1.3.1/lib/hanami/controller/configuration.rb
Overview
A set of logically grouped actions
Defined Under Namespace
Classes: Configuration, Error, IllegalExposureError, MissingSessionError, UnknownFormatError
Constant Summary
- VERSION =
Defines the version
'1.3.1'.freeze
Class Method Summary collapse
-
.configure(&blk) ⇒ Object
Configure the framework.
-
.duplicate(mod, controllers = 'Controllers', &blk) ⇒ Module
Duplicate the framework and generate modules for the target application.
-
.load! ⇒ void
Framework loading entry point.
Class Method Details
.configure(&blk) ⇒ Object
Configure the framework. It yields the given block in the context of the configuration
Source: | on GitHub
def self.configure(&blk) configuration.instance_eval(&blk) end |
.duplicate(mod, controllers = 'Controllers', &blk) ⇒ Module
Duplicate the framework and generate modules for the target application
module MyApp::Controllers::Dashboard include MyApp::Controller
action 'Index' do # this will inject MyApp::Action def call(params) # … end end end
Source: | on GitHub
def self.duplicate(mod, controllers = 'Controllers', &blk) dupe.tap do |duplicated| mod.module_eval %{ module #{ controllers }; end } if controllers mod.module_eval %{ Action = Hanami::Action.dup } duplicated.module_eval %{ configure do action_module #{ mod }::Action end } duplicated.configure(&blk) if block_given? end end |
.load! ⇒ void
This method returns an undefined value.
Framework loading entry point
Source: | on GitHub
def self.load! configuration.load! end |