AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::SessionStore::DynamoDB::Locking::Null

Inherits:
Base
  • Object
show all
Defined in:
lib/aws/session_store/dynamo_db/locking/null.rb

Overview

This class gets and sets sessions without a locking strategy.

Instance Method Summary collapse

Methods inherited from Base

#delete_session, #handle_error, #initialize, #pack_data, #set_session_data

Constructor Details

This class inherits a constructor from Aws::SessionStore::DynamoDB::Locking::Base

Instance Method Details

#extract_data(env, result = nil) ⇒ String

Returns Session data.

Returns:

  • (String)

    Session data.



34
35
36
37
# File 'lib/aws/session_store/dynamo_db/locking/null.rb', line 34

def extract_data(env, result = nil)
  env['rack.initial_data'] = result[:item]["data"] if result[:item]
  unpack_data(result[:item]["data"]) if result[:item]
end

#get_session_data(env, sid) ⇒ Object

Retrieve session if it exists from the database by id. Unpack the data once retrieved from the database.



21
22
23
24
25
26
# File 'lib/aws/session_store/dynamo_db/locking/null.rb', line 21

def get_session_data(env, sid)
  handle_error(env) do
    result = @config.dynamo_db_client.get_item(get_session_opts(sid))
    extract_data(env, result)
  end
end

#get_session_opts(sid) ⇒ Hash

Returns Options for getting session.

Returns:

  • (Hash)

    Options for getting session.



29
30
31
# File 'lib/aws/session_store/dynamo_db/locking/null.rb', line 29

def get_session_opts(sid)
  merge_all(table_opts(sid), attr_opts)
end