class

Rocket::Controller

Inherits Reference < Object

A controller defines actions. When called these actions execute the logic and return text to render through the response. A controller has a Hash of params which give access to all the params defined in the route and the query params.

Constructors

new

The macro stores actions as a Proc in a Hash so that actions['action_name'].call executes the action.

Source

Instance methods

action_exists?(action_name)

Returns true if the action with action_name has been defined in the controller, false otherwise.

Source
actions
Source
actions=(actions : Hash(String, -> String))
Source
context
Source
context=(context : HTTP::Server::Context)
Source
params
Source
params=(params : Hash(String, Nil | String))
Source