Class: LWS::Auth::Token
- Inherits:
-
Generic::Model
- Object
- Spyke::Base
- Generic::Model
- LWS::Auth::Token
- Defined in:
- lib/lws/apps/auth.rb
Overview
The token class
Instance Attribute Summary collapse
-
#account ⇒ Account
The account the token belongs to (through either the user or the device).
-
#account_id ⇒ Integer
The ID of the account the token belongs to.
-
#created_on ⇒ Object
readonly
deprecated
Deprecated.
This is an old alias of Generic::Model#created_at.
-
#device ⇒ Device?
The device the token belongs to.
-
#device_id ⇒ Integer?
The ID of the device the token belongs to.
-
#expires_on ⇒ String
The timestamp the token will (or has) expire(d).
-
#ip_address ⇒ String
The location/IP address the token is used on.
-
#name ⇒ String?
The name of the token.
-
#token ⇒ String
The actual token string.
-
#used_on ⇒ String?
The timestamp the token was last used.
-
#user ⇒ User?
The user the token belongs to.
-
#user_agent ⇒ String?
The user agent/browser string when the token was used.
-
#user_id ⇒ Integer?
The ID of the user the token belongs to.
Attributes inherited from Generic::Model
#created_at, #id, #updated_at, #url, #url_html
Method Summary
Methods inherited from Generic::Model
#deep_dup, #dig, #reload, #rollback, #save
Instance Attribute Details
#account ⇒ Account
Returns the account the token belongs to (through either the user or the device).
324 |
# File 'lib/lws/apps/auth.rb', line 324 belongs_to :account, uri: nil |
#account_id ⇒ Integer
Returns the ID of the account the token belongs to.
328 |
# File 'lib/lws/apps/auth.rb', line 328 attribute :account_id |
#created_on ⇒ Object (readonly)
This is an old alias of Generic::Model#created_at.
342 |
# File 'lib/lws/apps/auth.rb', line 342 attribute :created_on |
#device ⇒ Device?
Each token is associated to either a user or a device.
Returns the device the token belongs to.
333 |
# File 'lib/lws/apps/auth.rb', line 333 belongs_to :device, uri: nil |
#device_id ⇒ Integer?
Returns the ID of the device the token belongs to.
337 |
# File 'lib/lws/apps/auth.rb', line 337 attribute :device_id |
#expires_on ⇒ String
Returns the timestamp the token will (or has) expire(d).
346 |
# File 'lib/lws/apps/auth.rb', line 346 attribute :expires_on |
#ip_address ⇒ String
Returns the location/IP address the token is used on.
350 |
# File 'lib/lws/apps/auth.rb', line 350 attribute :ip_address |
#name ⇒ String?
Returns the name of the token.
354 |
# File 'lib/lws/apps/auth.rb', line 354 attribute :name |
#token ⇒ String
Returns the actual token string.
358 |
# File 'lib/lws/apps/auth.rb', line 358 attribute :token |
#used_on ⇒ String?
Returns the timestamp the token was last used.
362 |
# File 'lib/lws/apps/auth.rb', line 362 attribute :used_on |
#user ⇒ User?
Each token is associated to either a user or a device.
Returns the user the token belongs to.
372 |
# File 'lib/lws/apps/auth.rb', line 372 belongs_to :user, uri: nil |
#user_agent ⇒ String?
Returns the user agent/browser string when the token was used.
367 |
# File 'lib/lws/apps/auth.rb', line 367 attribute :user_agent |
#user_id ⇒ Integer?
Returns the ID of the user the token belongs to.
376 |
# File 'lib/lws/apps/auth.rb', line 376 attribute :user_id |