Module: Utopia::Controller::Actions

Defined in:
lib/utopia/controller/actions.rb

Overview

A controller layer which invokes functinality based on the request path.

Examples:

on '*' do |request, path|
	succeed! content: 'Hello World'
end

Defined Under Namespace

Modules: ClassMethods Classes: Action

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



31
32
33
# File 'lib/utopia/controller/actions.rb', line 31

def self.prepended(base)
	base.extend(ClassMethods)
end

Instance Method Details

#process!(request, path) ⇒ Object

Invoke all matching actions. If no actions match, will call otherwise. If no action gives a response, the request is passed to super.



163
164
165
166
167
# File 'lib/utopia/controller/actions.rb', line 163

def process!(request, path)
	catch_response do
		self.class.dispatch(self, request, path)
	end || super
end