Sha256: fcc3c0b87c0ab0ec86f061e653e972c4a197a4157db8e403ed253cabcf9e66cf

Contents?: true

Size: 594 Bytes

Versions: 6

Compression:

Stored size: 594 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['aws']['access_key_id'],
        endpoint: env_credentials['aws']['sns']['endpoint'],
        region: env_credentials['aws']['region'],
        secret_access_key: env_credentials['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

6 entries across 6 versions & 1 rubygems

Version Path
aws-liam-0.0.7 lib/liam/common.rb
aws-liam-0.0.6 lib/liam/common.rb
aws-liam-0.0.5 lib/liam/common.rb
aws-liam-0.0.4 lib/liam/common.rb
aws-liam-0.0.3 lib/liam/common.rb
aws-liam-0.0.2 lib/liam/common.rb