Class: Doorkeeper::OAuth::Client::Credentials

Inherits:
Struct
  • Object
show all
Extended by:
Methods
Defined in:
lib/doorkeeper/oauth/client/credentials.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Methods

from_basic, from_params

Instance Attribute Details

#secretObject

Returns the value of attribute secret

Returns:

  • (Object)

    the current value of secret


4
5
6
# File 'lib/doorkeeper/oauth/client/credentials.rb', line 4

def secret
  @secret
end

#uidObject

Returns the value of attribute uid

Returns:

  • (Object)

    the current value of uid


4
5
6
# File 'lib/doorkeeper/oauth/client/credentials.rb', line 4

def uid
  @uid
end

Class Method Details

.from_request(request, *credentials_methods) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/doorkeeper/oauth/client/credentials.rb', line 7

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

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/doorkeeper/oauth/client/credentials.rb', line 15

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