Class: Userbin::TokenStore
- Inherits:
-
Object
- Object
- Userbin::TokenStore
- Defined in:
- lib/userbin/token_store.rb
Instance Method Summary collapse
-
#initialize(cookies) ⇒ TokenStore
constructor
A new instance of TokenStore.
- #session_token ⇒ Object
- #session_token=(value) ⇒ Object
- #trusted_device_token ⇒ Object
- #trusted_device_token=(value) ⇒ Object
Constructor Details
#initialize(cookies) ⇒ TokenStore
Returns a new instance of TokenStore.
3 4 5 |
# File 'lib/userbin/token_store.rb', line 3 def initialize() @cookies = end |
Instance Method Details
#session_token ⇒ Object
7 8 9 10 |
# File 'lib/userbin/token_store.rb', line 7 def session_token token = @cookies['_ubs'] Userbin::SessionToken.new(token) if token end |
#session_token=(value) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/userbin/token_store.rb', line 12 def session_token=(value) @cookies['_ubs'] = value if value && value != @cookies['_ubs'] @cookies['_ubs'] elsif !value @cookies['_ubs'] = nil end end |
#trusted_device_token ⇒ Object
22 23 24 |
# File 'lib/userbin/token_store.rb', line 22 def trusted_device_token @cookies['_ubt'] end |
#trusted_device_token=(value) ⇒ Object
26 27 28 |
# File 'lib/userbin/token_store.rb', line 26 def trusted_device_token=(value) @cookies['_ubt'] = value end |