Class: HashPipe::Backends::S3
- Inherits:
-
Object
- Object
- HashPipe::Backends::S3
- Defined in:
- lib/hashpipe/backends/s3.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(archived_attribute) ⇒ S3
constructor
A new instance of S3.
- #load ⇒ Object
- #save(content) ⇒ Object
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
#destroy ⇒ Object
17 18 19 |
# File 'lib/hashpipe/backends/s3.rb', line 17 def destroy bucket.key(key_name).delete end |
#load ⇒ Object
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 |