Sha256: c85d5ad6f62babc13197028339057d4535aa70abfead64b7f6b398f016e43aad

Contents?: true

Size: 828 Bytes

Versions: 13

Compression:

Stored size: 828 Bytes

Contents

module Rack
  module OAuth2
    module Server
      module Rails
        module ResponseExt
          def redirect?
            ensure_finish do
              super
            end
          end

          def location
            ensure_finish do
              super
            end
          end

          def json
            ensure_finish do
              @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, @body = finish unless finished?
            yield
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rack-oauth2-1.21.2 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.21.1 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.21.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.20.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.19.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.18.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.17.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.16.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.15.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.14.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.13.0 lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.13.0.beta lib/rack/oauth2/server/rails/response_ext.rb
rack-oauth2-1.11.0 lib/rack/oauth2/server/rails/response_ext.rb