Class: Heirloom::Destroyer::S3

Inherits:
Object
  • Object
show all
Defined in:
lib/heirloom/destroyer/s3.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ S3

Returns a new instance of S3.



7
8
9
10
# File 'lib/heirloom/destroyer/s3.rb', line 7

def initialize(args)
  self.config = args[:config]
  self.region = args[:region]
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/heirloom/destroyer/s3.rb', line 5

def config
  @config
end

#regionObject

Returns the value of attribute region.



5
6
7
# File 'lib/heirloom/destroyer/s3.rb', line 5

def region
  @region
end

Instance Method Details

#destroy_file(args) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/heirloom/destroyer/s3.rb', line 12

def destroy_file(args)
  key_name = args[:key_name]
  key_folder = args[:key_folder]
  bucket = args[:bucket]

  s3.delete_object bucket, "#{key_folder}/#{key_name}"
end