Class: Flame::Route::Executable

Inherits:
Object
  • Object
show all
Defined in:
lib/flame/route.rb

Overview

Class for Route execution

Instance Method Summary collapse

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