Class: Common::Client::Session
- Inherits:
-
RedisStore
- Object
- RedisStore
- Common::Client::Session
- Defined in:
- lib/common/client/session.rb
Overview
A generic session model - see how RX implements it
Direct Known Subclasses
BBInternal::ClientSession, MedicalRecords::ClientSession, Rx::ClientSession, SM::ClientSession
Constant Summary collapse
- EXPIRATION_THRESHOLD_SECONDS =
20
Constants inherited from RedisStore
RedisStore::REQ_CLASS_INSTANCE_VARS
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from RedisStore
create, delete, #destroy, #destroyed?, exists?, #expire, find, #initialize, #initialize_dup, keys, #persisted?, pop, redis_key, redis_store, redis_ttl, #save, #save!, #ttl, #update, #update!
Constructor Details
This class inherits a constructor from Common::RedisStore
Class Method Details
.find_or_build(attributes) ⇒ Object
17 18 19 |
# File 'lib/common/client/session.rb', line 17 def self.find_or_build(attributes) find(attributes[redis_namespace_key]) || new(attributes) end |
Instance Method Details
#expired? ⇒ Boolean
21 22 23 24 25 |
# File 'lib/common/client/session.rb', line 21 def expired? return true if expires_at.nil? expires_at.to_i <= Time.now.utc.to_i + EXPIRATION_THRESHOLD_SECONDS end |
#original_json ⇒ Object
27 28 29 |
# File 'lib/common/client/session.rb', line 27 def original_json nil end |