class

Rocket::Route

Inherits Reference < Object

A Route is defined by:

  • an HTTP method
  • an URL path
  • a controller instance
  • the action to call

Constructors

new(method : String, path : String, controller : Controller, action : String)

Stores information and generate regex for the router to match the correct path.

Source

Instance methods

action
Source
call_action(context)

Store the current context in the controller, extract parameters from it, call the action then return the result.

Source
controller
Source
method
Source
param_names
Source
path
Source
regex
Source