Sha256: 6e998cdda06b1ad53ccce81e9e5444f83260eb5c6857bf9e4d849fcf783668bd

Contents?: true

Size: 855 Bytes

Versions: 21

Compression:

Stored size: 855 Bytes

Contents

module Rack
  module OAuth2
    module Server
      module Rails
        module ResponseExt
          def redirect?
            ensure_finish do
              @response.redirect?
            end
          end

          def location
            ensure_finish do
              super
            end
          end

          def json
            ensure_finish do
              @response.body
            end
          end

          def header
            ensure_finish do
              @header
            end
          end

          def finish
            @finished = true
            super
          end

          private

          def finished?
            !!@finished
          end

          def ensure_finish
            @status, @header, @response = finish unless finished?
            yield
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rack-oauth2-1.12.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.10.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.10.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.9.3 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.9.2 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.9.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.9.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.8.2 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.8.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.8.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.7.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.7.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.6.4 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.6.3 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.6.2 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.6.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.6.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.5.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.5.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.4.0 lib/rack/oauth2/server/rails/response_ext.rb