Class: Mara::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/mara/client.rb

Overview

Internal DynamoDB client.

Author:

  • Maddie Schipper

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.create_clientAws::DynamoDB::Client

Create a new DynamoDB client.

Returns:

  • (Aws::DynamoDB::Client)

Since:

  • 1.0.0



21
22
23
24
25
26
27
28
29
30
# File 'lib/mara/client.rb', line 21

def create_client
  params = {
    region:  Mara.config.aws.region,
    simple_attributes: false
  }
  if (endpoint =  Mara.config.dynamodb.endpoint)
    params[:endpoint] = endpoint
  end
  Aws::DynamoDB::Client.new(params)
end

.sharedAws::DynamoDB::Client

The shared client.

Returns:

  • (Aws::DynamoDB::Client)

Since:

  • 1.0.0



38
39
40
# File 'lib/mara/client.rb', line 38

def shared
  @shared ||= create_client
end