module Roda::RodaPlugins::ResponseRequest::InstanceMethods

  1. lib/roda/plugins/response_request.rb

This isn’t set because it breaks usage with the error_handler/class_level_routing plugins and the shape_friendly plugin, due to those calling RodaResponse#initialize, which would reset @request to nil. It isn’t strictly necessary to set this for shape friendliness, as the Roda#initialize sets it directly after creating the RodaRequest, so in normal use, the instance variable will already be set. RESPONSE_INSTANCE_VARIABLES = [:@request].freeze

Methods

Public Class

  1. new

Public Class methods

new(env)

Set the response’s request to the current request.

[show source]
   # File lib/roda/plugins/response_request.rb
22 def initialize(env)
23   super
24   @_response.request = @_request
25 end