Class: DynamoDbStore

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamodb_framework/dynamodb_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDynamoDbStore

Returns a new instance of DynamoDbStore.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/dynamodb_framework/dynamodb_store.rb', line 4

def initialize
  region = ENV['DYNAMODB_REGION']
  endpoint = ENV['DYNAMODB_ENDPOINT']
  secret = ENV['DYNAMODB_SECRET']
  key = ENV['DYNAMODB_ACCESS_KEY']
  if endpoint != nil
    @client = Aws::DynamoDB::Client.new(region: region, endpoint: endpoint, secret_access_key: secret, access_key_id: key)
  else
    @client = Aws::DynamoDB::Client.new(region: region, secret_access_key: secret, access_key_id: key)
  end
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



2
3
4
# File 'lib/dynamodb_framework/dynamodb_store.rb', line 2

def client
  @client
end