Sha256: 8b3105e5b6ab66eabc35112aa30f285371bb72a35febe08f5630af5341ba994a

Contents?: true

Size: 563 Bytes

Versions: 49

Compression:

Stored size: 563 Bytes

Contents

module Doorkeeper
  module OAuth
    class Client
      class Credentials < Struct.new(:uid, :secret)
        extend Methods

        def self.from_request(request, *credentials_methods)
          credentials_methods.inject(nil) do |credentials, method|
            method = self.method(method) if method.is_a?(Symbol)
            credentials = Credentials.new *method.call(request)
            break credentials unless credentials.blank?
          end
        end

        def blank?
          uid.blank? || secret.blank?
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
doorkeeper-0.6.2 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.6.1 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.6.0 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.6.0.rc1 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.5.0 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.5.0.rc1 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.4.2 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.4.1 lib/doorkeeper/oauth/client/credentials.rb
doorkeeper-0.4.0 lib/doorkeeper/oauth/client/credentials.rb