Sha256: e8a805f2e5b3e6deb07d11aeb8970a4fd78785afaf8e35cdc28e1b0cf1c9c6fa

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

require 'yaml'

module Liam
  module Common
    CONFIG_FILE = File.expand_path('config/liam.yml')

    def client_options
      {
        access_key_id: env_credentials.dig('aws', 'access_key_id'),
        endpoint: env_credentials.dig('aws', 'sns', 'endpoint'),
        region: env_credentials.dig('aws', 'region'),
        secret_access_key: env_credentials.dig('aws', 'secret_access_key')
      }.compact
    end

    def env_credentials
      @env_credentials ||= credentials[ENV['RAILS_ENV']]
    end

    def credentials
      YAML.load_file(CONFIG_FILE)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aws-liam-0.0.9 lib/liam/common.rb