Class: Doorkeeper::OAuth::PreAuthorization
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::PreAuthorization
- Includes:
- Validations
- Defined in:
- lib/doorkeeper/oauth/pre_authorization.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#response_type ⇒ Object
Returns the value of attribute response_type.
- #scope ⇒ Object
-
#server ⇒ Object
Returns the value of attribute server.
-
#state ⇒ Object
Returns the value of attribute state.
Attributes included from Validations
Instance Method Summary collapse
- #authorizable? ⇒ Boolean
- #error_response ⇒ Object
-
#initialize(server, client, attrs = {}) ⇒ PreAuthorization
constructor
A new instance of PreAuthorization.
- #scopes ⇒ Object
Methods included from Validations
Constructor Details
#initialize(server, client, attrs = {}) ⇒ PreAuthorization
Returns a new instance of PreAuthorization.
14 15 16 17 18 19 20 21 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 14 def initialize(server, client, attrs = {}) @server = server @client = client @response_type = attrs[:response_type] @redirect_uri = attrs[:redirect_uri] @scope = attrs[:scope] @state = attrs[:state] end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
11 12 13 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 11 def client @client end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
11 12 13 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 11 def redirect_uri @redirect_uri end |
#response_type ⇒ Object
Returns the value of attribute response_type.
11 12 13 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 11 def response_type @response_type end |
#scope ⇒ Object
31 32 33 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 31 def scope @scope.presence || server.default_scopes.to_s end |
#server ⇒ Object
Returns the value of attribute server.
11 12 13 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 11 def server @server end |
#state ⇒ Object
Returns the value of attribute state.
11 12 13 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 11 def state @state end |
Instance Method Details
#authorizable? ⇒ Boolean
23 24 25 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 23 def return true end |
#error_response ⇒ Object
35 36 37 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 35 def error_response Doorkeeper::OAuth::ErrorResponse.from_request(self) end |
#scopes ⇒ Object
27 28 29 |
# File 'lib/doorkeeper/oauth/pre_authorization.rb', line 27 def scopes Scopes.from_string scope end |