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.9.0 lib/roda/plugins/response_request.rb
roda-3.8.0 lib/roda/plugins/response_request.rb
roda-3.7.0 lib/roda/plugins/response_request.rb
roda-3.6.0 lib/roda/plugins/response_request.rb
roda-3.5.0 lib/roda/plugins/response_request.rb
roda-3.4.0 lib/roda/plugins/response_request.rb
roda-3.3.0 lib/roda/plugins/response_request.rb
roda-3.2.0 lib/roda/plugins/response_request.rb
roda-3.1.0 lib/roda/plugins/response_request.rb
roda-3.0.0 lib/roda/plugins/response_request.rb
roda-2.29.0 lib/roda/plugins/response_request.rb
roda-2.28.0 lib/roda/plugins/response_request.rb
roda-2.27.0 lib/roda/plugins/response_request.rb
roda-2.26.0 lib/roda/plugins/response_request.rb
roda-2.25.0 lib/roda/plugins/response_request.rb
roda-2.24.0 lib/roda/plugins/response_request.rb
roda-2.23.0 lib/roda/plugins/response_request.rb
roda-2.22.0 lib/roda/plugins/response_request.rb
roda-2.21.0 lib/roda/plugins/response_request.rb
roda-2.20.0 lib/roda/plugins/response_request.rb