Class: Flame::Route::Executable
- Inherits:
-
Object
- Object
- Flame::Route::Executable
- Defined in:
- lib/flame/route.rb
Overview
Class for Route execution
Instance Method Summary collapse
- #execute_errors(status = 500) ⇒ Object
-
#initialize(route) ⇒ Executable
constructor
A new instance of Executable.
-
#run!(dispatcher) ⇒ Object
Execute route from Dispatcher.
Constructor Details
#initialize(route) ⇒ Executable
Returns a new instance of Executable.
99 100 101 |
# File 'lib/flame/route.rb', line 99 def initialize(route) @route = route end |
Instance Method Details
#execute_errors(status = 500) ⇒ Object
112 113 114 |
# File 'lib/flame/route.rb', line 112 def execute_errors(status = 500) execute_hooks(:error, status) end |
#run!(dispatcher) ⇒ Object
Execute route from Dispatcher
104 105 106 107 108 109 110 |
# File 'lib/flame/route.rb', line 104 def run!(dispatcher) @ctrl = @route[:controller].new(dispatcher) execute_hooks(:before) result = @ctrl.send(@route[:action], *arranged_params) execute_hooks(:after) result end |