Class: Auth::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/auth/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeToken

Returns a new instance of Token.



5
6
7
8
9
# File 'lib/auth/token.rb', line 5

def initialize
  @hex = ActiveSupport::SecureRandom.hex(64)
  # base64 url, see RFC4648
  @token = SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n")
end

Instance Attribute Details

#tokenObject (readonly) Also known as: to_s

Returns the value of attribute token.



2
3
4
# File 'lib/auth/token.rb', line 2

def token
  @token
end