Sha256: bed631025722567ba9c98611dc036efe3d48bcf7b399724d4b3ab9956a63f353

Contents?: true

Size: 650 Bytes

Versions: 96

Compression:

Stored size: 650 Bytes

Contents

module OAuth
  module RequestProxy
    def self.available_proxies #:nodoc:
      @available_proxies ||= {}
    end

    def self.proxy(request, options = {})
      return request if request.kind_of?(OAuth::RequestProxy::Base)

      klass = available_proxies[request.class]

      # Search for possible superclass matches.
      if klass.nil?
        request_parent = available_proxies.keys.find { |rc| request.kind_of?(rc) }
        klass = available_proxies[request_parent]
      end

      raise UnknownRequestType, request.class.to_s unless klass
      klass.new(request, options)
    end

    class UnknownRequestType < Exception; end
  end
end

Version data entries

96 entries across 93 versions & 27 rubygems

Version Path
oauth-0.5.8 lib/oauth/request_proxy.rb
oauth-0.5.7 lib/oauth/request_proxy.rb
oauth-0.5.7.pre.pre1 lib/oauth/request_proxy.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/oauth-0.5.6/lib/oauth/request_proxy.rb
oauth-0.5.6 lib/oauth/request_proxy.rb
oauth-0.5.5 lib/oauth/request_proxy.rb
tdiary-5.0.8 vendor/bundle/gems/oauth-0.5.4/lib/oauth/request_proxy.rb
oauth-0.5.4 lib/oauth/request_proxy.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.3/lib/oauth/request_proxy.rb
oauth-0.5.3 lib/oauth/request_proxy.rb
oauth-0.5.2 lib/oauth/request_proxy.rb
tdiary-5.0.4 vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy.rb
oauth-0.5.1 lib/oauth/request_proxy.rb
oauth-0.5.0 lib/oauth/request_proxy.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/oauth-0.4.7/lib/oauth/request_proxy.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/oauth-0.4.7/lib/oauth/request_proxy.rb
oauth-ap-0.4.8 lib/oauth/request_proxy.rb
greut-oauth-0.3.6 lib/oauth/request_proxy.rb