Class: LaunchDarkly::Impl::Integrations::DynamoDB::DynamoDBStoreImplBase

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/integrations/dynamodb_impl.rb

Overview

Since:

  • 5.5.0

Constant Summary collapse

PARTITION_KEY =

Since:

  • 5.5.0

"namespace"
SORT_KEY =

Since:

  • 5.5.0

"key"

Instance Method Summary collapse

Constructor Details

#initialize(table_name, opts) ⇒ DynamoDBStoreImplBase

Returns a new instance of DynamoDBStoreImplBase.

Since:

  • 5.5.0



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 23

def initialize(table_name, opts)
  unless AWS_SDK_ENABLED
    raise RuntimeError.new("can't use #{description} without the aws-sdk or aws-sdk-dynamodb gem")
  end

  @table_name = table_name
  @prefix = opts[:prefix] ? (opts[:prefix] + ":") : ""
  @logger = opts[:logger] || Config.default_logger

  if !opts[:existing_client].nil?
    @client = opts[:existing_client]
  else
    @client = Aws::DynamoDB::Client.new(opts[:dynamodb_opts] || {})
  end

  @logger.info("#{description}: using DynamoDB table \"#{table_name}\"")
end

Instance Method Details

#stopObject

Since:

  • 5.5.0



41
42
43
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 41

def stop
  # AWS client doesn't seem to have a close method
end