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.
7 8 9 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 7 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
29 30 31 32 33 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 29 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
24 25 26 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 24 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
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/aws/session_store/dynamo_db/locking/base.rb', line 12 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 |