Module: AWS::SessionStore::DynamoDB::Table
- Defined in:
- lib/aws/session_store/dynamo_db/table.rb
Overview
This class provides a way to create and delete a session table.
Class Method Summary collapse
-
.create_table(options = {}) ⇒ Object
Creates a session table.
-
.delete_table(options = {}) ⇒ Object
Deletes a session table.
Class Method Details
.create_table(options = {}) ⇒ Object
Creates a session table.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/aws/session_store/dynamo_db/table.rb', line 24 def create_table( = {}) config = load_config() = properties(config.table_name, config.table_key).merge( throughput(config.read_capacity, config.write_capacity) ) config.dynamo_db_client.create_table() logger << "Table #{config.table_name} created, waiting for activation...\n" block_until_created(config) logger << "Table #{config.table_name} is now ready to use.\n" rescue AWS::DynamoDB::Errors::ResourceInUseException logger << "Table #{config.table_name} already exists, skipping creation.\n" end |
.delete_table(options = {}) ⇒ Object
Deletes a session table.
39 40 41 42 |
# File 'lib/aws/session_store/dynamo_db/table.rb', line 39 def delete_table( = {}) config = load_config() config.dynamo_db_client.delete_table(:table_name => config.table_name) end |