Class: Aws::SessionStore::DynamoDB::Locking::Base Private
- Inherits:
-
Object
- Object
- Aws::SessionStore::DynamoDB::Locking::Base
- Defined in:
- lib/aws/session_store/dynamo_db/locking/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handles session management.
Direct Known Subclasses
Instance Method Summary collapse
-
#delete_session(env, sid) ⇒ Object
private
Deletes session based on id.
-
#get_session_data(env, sid) ⇒ Object
private
Retrieves session data based on id.
-
#initialize(cfg) ⇒ Base
constructor
private
A new instance of Base.
-
#set_session_data(env, sid, session, options = {}) ⇒ Object
private
Updates session in database.
Constructor Details
#initialize(cfg) ⇒ Base
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Base.
9 10 11 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 9 def initialize(cfg) @config = cfg end |
Instance Method Details
#delete_session(env, sid) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deletes session based on id
31 32 33 34 35 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 31 def delete_session(env, sid) handle_error(env) do @config.dynamo_db_client.delete_item(delete_opts(sid)) end end |
#get_session_data(env, sid) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Retrieves session data based on id
26 27 28 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 26 def get_session_data(env, sid) raise NotImplementedError end |
#set_session_data(env, sid, session, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Updates session in database
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 14 def set_session_data(env, sid, session, = {}) return false if session.empty? packed_session = pack_data(session) handle_error(env) do save_opts = update_opts(env, sid, packed_session, ) @config.dynamo_db_client.update_item(save_opts) sid end end |