Class: Zumobi::S3
- Inherits:
-
Object
- Object
- Zumobi::S3
- Defined in:
- lib/zumobi/amazon_s3.rb
Class Method Summary collapse
- .establish_s3_connection ⇒ Object
- .save_in_s3(data, options = Hash.new) ⇒ Object
- .save_in_s3_with_path(data, path, options = Hash.new) ⇒ Object
Class Method Details
.establish_s3_connection ⇒ Object
3 4 5 6 7 |
# File 'lib/zumobi/amazon_s3.rb', line 3 def self.establish_s3_connection config = Zumobi::S3.config() AWS::S3::Base.establish_connection!( :access_key_id => config.access_key_id, :secret_access_key => config.secret_access_key ) puts "Connected to s3" end |
.save_in_s3(data, options = Hash.new) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/zumobi/amazon_s3.rb', line 9 def self.save_in_s3(data, =Hash.new) establish_s3_connection config = Zumobi::S3.config() puts "Sending file to http://#{config.bucket}/#{config.path}" AWS::S3::S3Object.store(config.path, data, config.bucket, ) end |
.save_in_s3_with_path(data, path, options = Hash.new) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/zumobi/amazon_s3.rb', line 16 def self.save_in_s3_with_path(data, path, =Hash.new) establish_s3_connection config = Zumobi::S3.config() puts "Sending file to http://#{config.bucket}/#{path}" AWS::S3::S3Object.store(path, data, config.bucket, ) end |