module Controller

A middleware which loads controller classes and invokes functionality based on the requested path.

Classes and Modules

module Actions

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

class Base

The base implementation of a controller class.

class Middleware < Protocol::HTTP::Middleware

Dispatches requests to filesystem-backed controller classes.

module Respond

A controller layer which provides a convenient way to respond to different requested content types. The order in which you add converters matters, as it determines how the incoming Accept: header is mapped, e.g. the first converter is also defined as matching the media range /.

module Handlers
class Responder

Negotiates response content types and invokes the matching handler.

module Rewrite

This controller layer rewrites the path before executing controller actions. When the rule matches, the supplied block is executed.

class Variables

Provides a stack-based instance variable lookup mechanism. It can flatten a stack of controllers into a single hash.

Definitions

Result = Data.define(:status, :headers, :value)

A semantic controller result awaiting response negotiation.

def self.[](request)

Return the controller variables associated with the request.

Signature

parameter request Utopia::Request

The application request.

returns Variables | Nil

The current variables.

Implementation

def self.[] request
	request.variables
end

def self.new(...)

Construct controller middleware.

Signature

returns Controller::Middleware

The controller middleware.

Implementation

def self.new(...)
	Middleware.new(...)
end