Class: LWS::Auth::Token

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

Overview

The token class

Instance Attribute Summary collapse

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)



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

belongs_to :account, uri: nil

#account_idFixnum

Returns the ID of the account the token belongs to.

Returns:

  • (Fixnum)

    the ID of the account the token belongs to



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

attribute :account_id

#created_atString (readonly)

Returns the timestamp of when the token was created.

Returns:

  • (String)

    the timestamp of when the token was created



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

attribute :created_at

#created_onObject (readonly)

Deprecated.

This is an old alias of #created_at.



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

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



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

belongs_to :device, uri: nil

#device_idFixnum?

Returns the ID of the device the token belongs to.

Returns:

  • (Fixnum, nil)

    the ID of the device the token belongs to



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

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)



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

attribute :expires_on

#idFixnum (readonly)

Returns the (unique) ID of the token.

Returns:

  • (Fixnum)

    the (unique) ID of the token



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

attribute :id

#ip_addressString

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

Returns:

  • (String)

    the location/IP address the token is used on



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

attribute :ip_address

#nameString?

Returns the name of the token.

Returns:

  • (String, nil)

    the name of the token



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

attribute :name

#tokenString

Returns the actual token string.

Returns:

  • (String)

    the actual token string



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

attribute :token

#updated_atString (readonly)

Returns the timestamp of when the token was last updated.

Returns:

  • (String)

    the timestamp of when the token was last updated



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

attribute :updated_at

#used_onString?

Returns the timestamp the token was last used.

Returns:

  • (String, nil)

    the timestamp the token was last used



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

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



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

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



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

attribute :user_agent

#user_idFixnum?

Returns the ID of the user the token belongs to.

Returns:

  • (Fixnum, nil)

    the ID of the user the token belongs to



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

attribute :user_id