Class: LWS::Auth::Token

Inherits:
Generic::Model show all
Defined in:
lib/lws/apps/auth.rb

Overview

The token class

Instance Attribute Summary collapse

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

#accountAccount

Returns the account the token belongs to (through either the user or the device).

Returns:

  • (Account)

    the account the token belongs to (through either the user or the device)



334
# File 'lib/lws/apps/auth.rb', line 334

belongs_to :account, uri: nil

#account_idInteger

Returns the ID of the account the token belongs to.

Returns:

  • (Integer)

    the ID of the account the token belongs to



338
# File 'lib/lws/apps/auth.rb', line 338

attribute :account_id

#created_onObject (readonly)

Deprecated.

This is an old alias of Generic::Model#created_at.



352
# File 'lib/lws/apps/auth.rb', line 352

attribute :created_on

#deviceDevice?

Note:

Each token is associated to either a user or a device.

Returns the device the token belongs to.

Returns:

  • (Device, nil)

    the device the token belongs to



343
# File 'lib/lws/apps/auth.rb', line 343

belongs_to :device, uri: nil

#device_idInteger?

Returns the ID of the device the token belongs to.

Returns:

  • (Integer, nil)

    the ID of the device the token belongs to



347
# File 'lib/lws/apps/auth.rb', line 347

attribute :device_id

#expires_onString

Returns the timestamp the token will (or has) expire(d).

Returns:

  • (String)

    the timestamp the token will (or has) expire(d)



356
# File 'lib/lws/apps/auth.rb', line 356

attribute :expires_on

#ip_addressString

Returns the location/IP address the token is used on.

Returns:

  • (String)

    the location/IP address the token is used on



360
# File 'lib/lws/apps/auth.rb', line 360

attribute :ip_address

#nameString?

Returns the name of the token.

Returns:

  • (String, nil)

    the name of the token



364
# File 'lib/lws/apps/auth.rb', line 364

attribute :name

#tokenString

Returns the actual token string.

Returns:

  • (String)

    the actual token string



368
# File 'lib/lws/apps/auth.rb', line 368

attribute :token

#used_onString?

Returns the timestamp the token was last used.

Returns:

  • (String, nil)

    the timestamp the token was last used



372
# File 'lib/lws/apps/auth.rb', line 372

attribute :used_on

#userUser?

Note:

Each token is associated to either a user or a device.

Returns the user the token belongs to.

Returns:

  • (User, nil)

    the user the token belongs to



382
# File 'lib/lws/apps/auth.rb', line 382

belongs_to :user, uri: nil

#user_agentString?

Returns the user agent/browser string when the token was used.

Returns:

  • (String, nil)

    the user agent/browser string when the token was used



377
# File 'lib/lws/apps/auth.rb', line 377

attribute :user_agent

#user_idInteger?

Returns the ID of the user the token belongs to.

Returns:

  • (Integer, nil)

    the ID of the user the token belongs to



386
# File 'lib/lws/apps/auth.rb', line 386

attribute :user_id