Class: Dynamodb::Api::Adapter

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

Instance Method Summary collapse

Instance Method Details

#clientObject



27
28
29
# File 'lib/dynamodb/api/adapter.rb', line 27

def client
  @client
end

#connect!Object



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

def connect!
  @client = Aws::DynamoDB::Client.new(connect_config)
end

#connect_configObject



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

def connect_config
  @connect_hash = {}

  if Dynamodb::Api::Config.endpoint?
    @connect_hash[:endpoint] = Dynamodb::Api::Config.endpoint
  end
  if Dynamodb::Api::Config.access_key?
    @connect_hash[:access_key_id] = Dynamodb::Api::Config.access_key
  end
  if Dynamodb::Api::Config.secret_key?
    @connect_hash[:secret_access_key] = Dynamodb::Api::Config.secret_key
  end
  if Dynamodb::Api::Config.region?
    @connect_hash[:region] = Dynamodb::Api::Config.region
  end

  @connect_hash
end