module Roda::RodaPlugins::Base::InstanceMethods
def call(&block)
the route block can throw :halt at any point with the
receiver, with the related request. Catch :halt so that
instance_exec the route block in the scope of the
def call(&block) catch(:halt) do r = @_request r.block_result(instance_exec(r, &block)) @_response.finish end end
def env
The environment hash for the current request. Example:
def env @_request.env end
def initialize(env)
def initialize(env) klass = self.class @_request = klass::RodaRequest.new(self, env) @_response = klass::RodaResponse.new end
def opts
opts[:render_opts].inspect
Roda.route do |r|
Roda.plugin :render
modified at the instance level. Example:
The class-level options hash. This should probably not be
def opts self.class.opts end
def session
if no session exists. Example:
The session hash for the current request. Raises RodaError
def session @_request.session end