module Roda::RodaPlugins::Base::InstanceMethods

def _route(&block)

behavior after the request and response have been setup.
Internals of #call, extracted so that plugins can override
def _route(&block)
  catch(:halt) do
    r = @_request
    r.block_result(instance_exec(r, &block))
    @_response.finish
  end
end

def call(env, &block)

called directly.
the request, handling any halts. This is not usually
class, the instance_exec the route block with
Create a request and response of the appopriate
def call(env, &block)
  @_request = self.class::RodaRequest.new(self, env)
  @_response = self.class::RodaResponse.new
  _route(&block)
end

def env

env['REQUEST_METHOD'] # => 'GET'

The environment hash for the current request. Example:
def env
  @_request.env
end

def opts

end
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 request

This is the same object yielded by Roda.route.
The instance of the request class related to this request.
def request
  @_request
end

def response

The instance of the response class related to this request.
def response
  @_response
end

def session

session # => {}

if no session exists. Example:
The session hash for the current request. Raises RodaError
def session
  @_request.session
end