Class: DeviseTokenAuth::TokenFactory::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/devise_token_auth/token_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject

Returns the value of attribute client

Returns:

  • (Object)

    the current value of client



105
106
107
# File 'lib/devise_token_auth/token_factory.rb', line 105

def client
  @client
end

#expiryObject

Returns the value of attribute expiry

Returns:

  • (Object)

    the current value of expiry



105
106
107
# File 'lib/devise_token_auth/token_factory.rb', line 105

def expiry
  @expiry
end

#tokenObject

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



105
106
107
# File 'lib/devise_token_auth/token_factory.rb', line 105

def token
  @token
end

#token_hashObject

Returns the value of attribute token_hash

Returns:

  • (Object)

    the current value of token_hash



105
106
107
# File 'lib/devise_token_auth/token_factory.rb', line 105

def token_hash
  @token_hash
end

Instance Method Details

#clear!Object

Sets all instance variables of the token to nil. It is faster than creating new empty token. Example:

token.clear!
=> true
token
=> #<struct DeviseTokenAuth::TokenFactory::Token client=nil, token=nil, token_hash=nil, expiry=nil>


112
113
114
115
# File 'lib/devise_token_auth/token_factory.rb', line 112

def clear!
  size.times { |i| self[i] = nil }
  true
end

#present?Boolean

Checks token attribute presence Example:

token.present?
=> true

Returns:

  • (Boolean)


121
122
123
# File 'lib/devise_token_auth/token_factory.rb', line 121

def present?
  token.present?
end