Sha256: 90658feb68b98f7d2f66e2c8e36fd190ab3882edba4ece468d76ad9ab74a66ef

Contents?: true

Size: 666 Bytes

Versions: 109

Compression:

Stored size: 666 Bytes

Contents

# frozen-string-literal: true

#
class Roda
  module RodaPlugins
    # The response_request plugin gives the response access to the
    # related request instance via the #request method.
    #
    # Example:
    #
    #   plugin :response_request
    module ResponseRequest
      module InstanceMethods
        # Set the response's request to the current request.
        def initialize(env)
          super
          @_response.request = @_request
        end
      end

      module ResponseMethods
        # The request related to this response.
        attr_accessor :request
      end
    end

    register_plugin(:response_request, ResponseRequest)
  end
end

Version data entries

109 entries across 109 versions & 1 rubygems

Version Path
roda-3.88.0 lib/roda/plugins/response_request.rb
roda-3.87.0 lib/roda/plugins/response_request.rb
roda-3.86.0 lib/roda/plugins/response_request.rb
roda-3.85.0 lib/roda/plugins/response_request.rb
roda-3.84.0 lib/roda/plugins/response_request.rb
roda-3.83.0 lib/roda/plugins/response_request.rb
roda-3.82.0 lib/roda/plugins/response_request.rb
roda-3.81.0 lib/roda/plugins/response_request.rb
roda-3.79.0 lib/roda/plugins/response_request.rb
roda-3.78.0 lib/roda/plugins/response_request.rb
roda-3.77.0 lib/roda/plugins/response_request.rb
roda-3.76.0 lib/roda/plugins/response_request.rb
roda-3.75.0 lib/roda/plugins/response_request.rb
roda-3.74.0 lib/roda/plugins/response_request.rb
roda-3.73.0 lib/roda/plugins/response_request.rb
roda-3.72.0 lib/roda/plugins/response_request.rb
roda-3.71.0 lib/roda/plugins/response_request.rb
roda-3.70.0 lib/roda/plugins/response_request.rb
roda-3.69.0 lib/roda/plugins/response_request.rb
roda-3.68.0 lib/roda/plugins/response_request.rb