Class: LWS::Auth::Token
- Inherits:
-
Generic::Model
- Object
- Generic::Model
- LWS::Auth::Token
- Defined in:
- lib/lws/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 ⇒ Fixnum
The ID of the account the token belongs to.
-
#created_at ⇒ String
The timestamp of when the token was created.
-
#device ⇒ Device
The device the token belongs to.
-
#device_id ⇒ Fixnum
The ID of the device the token belongs to.
-
#expires_on ⇒ String
The timestamp the token will (or has) expire(d).
-
#id ⇒ Fixnum
readonly
The (unique) ID of the token.
-
#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.
-
#updated_at ⇒ String
The timestamp of when the token was last updated.
-
#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 ⇒ Fixnum
The ID of the user the token belongs to.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(attrs = {}) ⇒ Token
Returns a new instance of Token.
263 264 265 |
# File 'lib/lws/auth.rb', line 263 def initialize(attrs = {}) super end |
Instance Attribute Details
#account ⇒ Account
Returns the account the token belongs to (through either the user or the device).
233 |
# File 'lib/lws/auth.rb', line 233 belongs_to :account |
#account_id ⇒ Fixnum
Returns the ID of the account the token belongs to.
|
|
# File 'lib/lws/auth.rb', line 235
|
#created_at ⇒ String
Returns the timestamp of when the token was created.
|
|
# File 'lib/lws/auth.rb', line 257
|
#device ⇒ Device
Each token is associated to either a user or a device.
Returns the device the token belongs to.
249 |
# File 'lib/lws/auth.rb', line 249 belongs_to :device |
#device_id ⇒ Fixnum
Returns the ID of the device the token belongs to.
|
|
# File 'lib/lws/auth.rb', line 251
|
#expires_on ⇒ String
Returns the timestamp the token will (or has) expire(d).
|
|
# File 'lib/lws/auth.rb', line 254
|
#id ⇒ Fixnum (readonly)
Returns the (unique) ID of the token.
|
|
# File 'lib/lws/auth.rb', line 212
|
#ip_address ⇒ String
Returns the location/IP address the token is used on.
|
|
# File 'lib/lws/auth.rb', line 224
|
#name ⇒ String
Returns the name of the token.
|
|
# File 'lib/lws/auth.rb', line 215
|
#token ⇒ String
Returns the actual token string.
|
|
# File 'lib/lws/auth.rb', line 218
|
#updated_at ⇒ String
Returns the timestamp of when the token was last updated.
263 264 265 |
# File 'lib/lws/auth.rb', line 263 def initialize(attrs = {}) super end |
#used_on ⇒ String
Returns the timestamp the token was last used.
|
|
# File 'lib/lws/auth.rb', line 221
|
#user ⇒ User
Each token is associated to either a user or a device.
Returns the user the token belongs to.
241 |
# File 'lib/lws/auth.rb', line 241 belongs_to :user |
#user_agent ⇒ String
Returns the user agent/browser string when the token was used.
|
|
# File 'lib/lws/auth.rb', line 227
|
#user_id ⇒ Fixnum
Returns the ID of the user the token belongs to.
|
|
# File 'lib/lws/auth.rb', line 243
|