Module: Egads::CommonConfig

Included in:
Config, RemoteConfig
Defined in:
lib/egads/config.rb

Instance Method Summary collapse

Instance Method Details

#configObject



4
5
6
# File 'lib/egads/config.rb', line 4

def config
  @config ||= YAML.load_file(config_path)
end

#s3_bucketObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/egads/config.rb', line 8

def s3_bucket
  @bucket ||= begin
    client = Aws::S3::Client.new(**{
      access_key_id:     config['s3']['access_key'],
      secret_access_key: config['s3']['secret_key'],
      region:            config['s3']['region'],
    }.compact)
    Aws::S3::Bucket.new(config['s3']['bucket'], client: client)
  end
end

#s3_prefixObject



19
20
21
# File 'lib/egads/config.rb', line 19

def s3_prefix
  config['s3']['prefix']
end