Class: DeviseTokenAuth::TokenFactory::Token
- Inherits:
-
Struct
- Object
- Struct
- DeviseTokenAuth::TokenFactory::Token
- Defined in:
- lib/devise_token_auth/token_factory.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#expiry ⇒ Object
Returns the value of attribute expiry.
-
#token ⇒ Object
Returns the value of attribute token.
-
#token_hash ⇒ Object
Returns the value of attribute token_hash.
Instance Method Summary collapse
-
#clear! ⇒ Object
Sets all instance variables of the token to nil.
-
#present? ⇒ Boolean
Checks token attribute presence Example: token.present? => true.
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client
105 106 107 |
# File 'lib/devise_token_auth/token_factory.rb', line 105 def client @client end |
#expiry ⇒ Object
Returns the value of attribute expiry
105 106 107 |
# File 'lib/devise_token_auth/token_factory.rb', line 105 def expiry @expiry end |
#token ⇒ Object
Returns the value of attribute token
105 106 107 |
# File 'lib/devise_token_auth/token_factory.rb', line 105 def token @token end |
#token_hash ⇒ Object
Returns the value of attribute token_hash
105 106 107 |
# File 'lib/devise_token_auth/token_factory.rb', line 105 def token_hash @token_hash end |
Instance Method Details
#clear! ⇒ Object
Sets all instance variables of the token to nil. It is faster than creating new empty token. Example:
token.clear!
=> true
token
=> #<struct DeviseTokenAuth::TokenFactory::Token client=nil, token=nil, token_hash=nil, expiry=nil>
112 113 114 115 |
# File 'lib/devise_token_auth/token_factory.rb', line 112 def clear! size.times { |i| self[i] = nil } true end |
#present? ⇒ Boolean
Checks token attribute presence Example:
token.present?
=> true
121 122 123 |
# File 'lib/devise_token_auth/token_factory.rb', line 121 def present? token.present? end |