Class: HashPipe::Backends::S3

Inherits:
Object
  • Object
show all
Defined in:
lib/hashpipe/backends/s3.rb

Instance Method Summary collapse

Constructor Details

#initialize(archived_attribute) ⇒ S3

Returns a new instance of S3.



8
9
10
11
# File 'lib/hashpipe/backends/s3.rb', line 8

def initialize(archived_attribute)
  @archived_attribute = archived_attribute
  @config = HashPipe::GlobalConfiguration.instance[:s3]
end

Instance Method Details

#destroyObject



17
18
19
# File 'lib/hashpipe/backends/s3.rb', line 17

def destroy
  bucket.key(key_name).delete
end

#loadObject



21
22
23
# File 'lib/hashpipe/backends/s3.rb', line 21

def load
  bucket.get(key_name)
end

#save(content) ⇒ Object



13
14
15
# File 'lib/hashpipe/backends/s3.rb', line 13

def save(content)
  bucket.put( key_name, StringIO.new( content ) ) unless content.nil?
end