Class: GrapeDeviseAuth::AuthorizerData
- Inherits:
-
Object
- Object
- GrapeDeviseAuth::AuthorizerData
- Defined in:
- lib/grape_devise_auth/authorizer_data.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#expiry ⇒ Object
readonly
Returns the value of attribute expiry.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
-
#warden ⇒ Object
readonly
Returns the value of attribute warden.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uid, client_id, token, expiry, warden) ⇒ AuthorizerData
constructor
A new instance of AuthorizerData.
- #token_prerequisites_present? ⇒ Boolean
Constructor Details
#initialize(uid, client_id, token, expiry, warden) ⇒ AuthorizerData
Returns a new instance of AuthorizerData.
5 6 7 8 9 10 11 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 5 def initialize(uid, client_id, token, expiry, warden) @uid = uid @client_id = client_id @token = token @expiry = expiry @warden = warden end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
3 4 5 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 3 def client_id @client_id end |
#expiry ⇒ Object (readonly)
Returns the value of attribute expiry.
3 4 5 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 3 def expiry @expiry end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 3 def token @token end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
3 4 5 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 3 def uid @uid end |
#warden ⇒ Object (readonly)
Returns the value of attribute warden.
3 4 5 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 3 def warden @warden end |
Class Method Details
.from_env(env) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 13 def self.from_env(env) new( env[Configuration::UID_KEY], env[Configuration::CLIENT_KEY] || 'default', env[Configuration::ACCESS_TOKEN_KEY], env[Configuration::EXPIRY_KEY], env['warden'] ) end |
Instance Method Details
#token_prerequisites_present? ⇒ Boolean
23 24 25 |
# File 'lib/grape_devise_auth/authorizer_data.rb', line 23 def token_prerequisites_present? token && uid end |