Class: Doorkeeper::OAuth::Client::Credentials
- Inherits:
-
Struct
- Object
- Struct
- Doorkeeper::OAuth::Client::Credentials
- Extended by:
- Methods
- Defined in:
- lib/doorkeeper/oauth/client/credentials.rb
Instance Attribute Summary collapse
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#uid ⇒ Object
Returns the value of attribute uid.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Methods
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret
4 5 6 |
# File 'lib/doorkeeper/oauth/client/credentials.rb', line 4 def secret @secret end |
#uid ⇒ Object
Returns the value of attribute 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
15 16 17 |
# File 'lib/doorkeeper/oauth/client/credentials.rb', line 15 def blank? uid.blank? || secret.blank? end |