Class: Pakada::Dispatch
- Inherits:
-
Object
- Object
- Pakada::Dispatch
- Includes:
- Module
- Defined in:
- lib/pakada/dispatch/module.rb,
lib/pakada/dispatch/version.rb,
lib/pakada/dispatch/controller.rb,
lib/pakada/dispatch.rb
Defined Under Namespace
Modules: Controller, Module
Constant Summary collapse
- VERSION =
"0.2.1"
Instance Attribute Summary collapse
-
#router ⇒ Object
readonly
Returns the value of attribute router.
Instance Method Summary collapse
- #boot ⇒ Object
- #hooks ⇒ Object
-
#initialize ⇒ Dispatch
constructor
A new instance of Dispatch.
Constructor Details
#initialize ⇒ Dispatch
Returns a new instance of Dispatch.
13 14 15 |
# File 'lib/pakada/dispatch.rb', line 13 def initialize @router = HttpRouter.new end |
Instance Attribute Details
#router ⇒ Object (readonly)
Returns the value of attribute router.
11 12 13 |
# File 'lib/pakada/dispatch.rb', line 11 def router @router end |
Instance Method Details
#boot ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pakada/dispatch.rb', line 21 def boot Pakada.modules.each_value {|mod| mod.extend Pakada.safety(::Pakada::Dispatch::Module) mod.load_controllers mod.routes if mod.respond_to? :routes } end |
#hooks ⇒ Object
17 18 19 |
# File 'lib/pakada/dispatch.rb', line 17 def hooks Pakada.instance.instead_of :request, @router.method(:call) end |