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