Class: Ant::Configuration::Autoconfigs::Aws::S3

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/ant/configs/autoconfigs/aws/s3.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

#array_wrap, #parse_type, #recursive_merge, #recursive_set, #split_env_string, #symbolize

Constructor Details

#initialize(config) ⇒ S3

Returns a new instance of S3.



14
15
16
17
18
19
20
21
22
23
# File 'lib/ant/configs/autoconfigs/aws/s3.rb', line 14

def initialize(config)
  @config = config
  @client = ::Aws::S3::Client.new(
    symbolize(config).reject { |k, _| %i[bucket test_connection].include? k }
  )
  @connection = ::Aws::S3::Bucket.new(
    name: config['bucket'],
    client: @client
  )
end

Class Method Details

.from_config(config) ⇒ Object



9
10
11
12
# File 'lib/ant/configs/autoconfigs/aws/s3.rb', line 9

def self.from_config(config)
  require 'aws-sdk-s3'
  new(config)
end

Instance Method Details

#rawObject



29
30
31
# File 'lib/ant/configs/autoconfigs/aws/s3.rb', line 29

def raw
  @connection
end

#sanity_checkObject



25
26
27
# File 'lib/ant/configs/autoconfigs/aws/s3.rb', line 25

def sanity_check
  false
end