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)



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

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



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

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



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

attribute :created_at

#created_onObject (readonly)

Deprecated.

This is an old alias of #created_at.



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

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



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

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



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

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)



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

attribute :expires_on

#idFixnum (readonly)

Returns the (unique) ID of the token.

Returns:

  • (Fixnum)

    the (unique) ID of the token



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

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



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

attribute :ip_address

#nameString?

Returns the name of the token.

Returns:

  • (String, nil)

    the name of the token



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

attribute :name

#tokenString

Returns the actual token string.

Returns:

  • (String)

    the actual token string



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

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



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

attribute :updated_at

#used_onString?

Returns the timestamp the token was last used.

Returns:

  • (String, nil)

    the timestamp the token was last used



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

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



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

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



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

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



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

attribute :user_id