Class: Doorkeeper::OAuth::ClientCredentialsRequest::Issuer
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::ClientCredentialsRequest::Issuer
- Defined in:
- lib/doorkeeper/oauth/client_credentials/issuer.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#token ⇒ Object
Returns the value of attribute token.
-
#validation ⇒ Object
Returns the value of attribute validation.
Instance Method Summary collapse
- #create(client, scopes, creator = Creator.new) ⇒ Object
-
#initialize(server, validation) ⇒ Issuer
constructor
A new instance of Issuer.
Constructor Details
#initialize(server, validation) ⇒ Issuer
Returns a new instance of Issuer.
9 10 11 |
# File 'lib/doorkeeper/oauth/client_credentials/issuer.rb', line 9 def initialize(server, validation) @server, @validation = server, validation end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
7 8 9 |
# File 'lib/doorkeeper/oauth/client_credentials/issuer.rb', line 7 def error @error end |
#token ⇒ Object
Returns the value of attribute token.
7 8 9 |
# File 'lib/doorkeeper/oauth/client_credentials/issuer.rb', line 7 def token @token end |
#validation ⇒ Object
Returns the value of attribute validation.
7 8 9 |
# File 'lib/doorkeeper/oauth/client_credentials/issuer.rb', line 7 def validation @validation end |
Instance Method Details
#create(client, scopes, creator = Creator.new) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/doorkeeper/oauth/client_credentials/issuer.rb', line 13 def create(client, scopes, creator = Creator.new) if validation.valid? @token = create_token(client, scopes, creator) @error = :server_error unless @token else @token = false @error = validation.error end @token end |