Class: Dynamocli::Table::StandaloneTable

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamocli/table/standalone_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(table_name:, table:, dynamodb: nil, logger: nil) ⇒ StandaloneTable

Returns a new instance of StandaloneTable.



8
9
10
11
12
13
# File 'lib/dynamocli/table/standalone_table.rb', line 8

def initialize(table_name:, table:, dynamodb: nil, logger: nil)
  @table_name = table_name
  @table = table
  @dynamodb = dynamodb || DYNAMODB.new
  @logger = logger || LOGGER.new
end

Instance Method Details

#alert_message_before_continueObject



15
16
17
# File 'lib/dynamocli/table/standalone_table.rb', line 15

def alert_message_before_continue
  "You're going to drop and recreate your #{@table_name} table!"
end

#eraseObject



19
20
21
22
23
# File 'lib/dynamocli/table/standalone_table.rb', line 19

def erase
  delete_table
  wait_for_deletion_to_complete
  create_table
end