Sha256: 89735181f5c37fd108a3d267914b60b35bef5d3038c69be7a39bdd05d66ef8ab

Contents?: true

Size: 528 Bytes

Versions: 4

Compression:

Stored size: 528 Bytes

Contents

require 'aws-sdk-dynamodb'
require 'cred_stash/repository/item'
require 'cred_stash/repository/dynamo_db'

module CredStash::Repository
  def self.instance
    case CredStash.config.storage
    when :dynamodb
      DynamoDB.new
    when :dynamodb_local
      endpoint = ENV['DYNAMODB_URL'] || 'http://localhost:8000'
      DynamoDB.new(
        client: Aws::DynamoDB::Client.new(
          endpoint: endpoint,
        )
      )
    else
      raise ArgumentError, "Unknown storage #{CredStash.config.storage}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rcredstash-2.0.0 lib/cred_stash/repository.rb
rcredstash-1.1.0 lib/cred_stash/repository.rb
rcredstash-1.0.1 lib/cred_stash/repository.rb
rcredstash-1.0.0 lib/cred_stash/repository.rb