Class: Dynamodb::Api::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamodb/api/adapter.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#_clientObject (readonly)

Returns the value of attribute _client.



4
5
6
# File 'lib/dynamodb/api/adapter.rb', line 4

def _client
  @_client
end

Class Method Details

.clientObject



6
7
8
# File 'lib/dynamodb/api/adapter.rb', line 6

def self.client
  @_client ||= Aws::DynamoDB::Client.new(connect_config)
end

.connect_configObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dynamodb/api/adapter.rb', line 10

def self.connect_config
  config_keys = %w(endpoint access_key_id secret_access_key region)
  @connect_hash = {}

  config_keys.each do |config_key|
    if Dynamodb::Api::Config.send("#{config_key}?")
      @connect_hash[config_key.to_sym] =
        Dynamodb::Api::Config.send(config_key)
    end
  end

  @connect_hash
end