Class: OmgPullRequest::Storage::Aws
- Inherits:
-
Object
- Object
- OmgPullRequest::Storage::Aws
- Defined in:
- lib/omg_pull_request/storage/aws.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#github_wrapper ⇒ Object
Returns the value of attribute github_wrapper.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Aws
constructor
A new instance of Aws.
- #store(data, file_name) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Aws
Returns a new instance of Aws.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/omg_pull_request/storage/aws.rb', line 5 def initialize(attributes={}) attributes.each do |attr, value| self.send("#{attr}=", value) end AWS::S3::Base.establish_connection!( :access_key_id => access_token, :secret_access_key => secret_token ) end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
4 5 6 |
# File 'lib/omg_pull_request/storage/aws.rb', line 4 def configuration @configuration end |
#github_wrapper ⇒ Object
Returns the value of attribute github_wrapper.
4 5 6 |
# File 'lib/omg_pull_request/storage/aws.rb', line 4 def github_wrapper @github_wrapper end |
Instance Method Details
#store(data, file_name) ⇒ Object
16 17 18 19 |
# File 'lib/omg_pull_request/storage/aws.rb', line 16 def store(data, file_name) AWS::S3::S3Object.store(file_name, data, bucket, :access => :public_read) "http://s3.amazonaws.com/#{bucket}/#{file_name}" end |