Class: Auth::Token
- Inherits:
-
Object
- Object
- Auth::Token
- Defined in:
- lib/auth/token.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize ⇒ Token
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
#token ⇒ Object (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 |