Class: OmgPullRequest::Storage::Aws

Inherits:
Object
  • Object
show all
Defined in:
lib/omg_pull_request/storage/aws.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configurationObject

Returns the value of attribute configuration.



4
5
6
# File 'lib/omg_pull_request/storage/aws.rb', line 4

def configuration
  @configuration
end

#github_wrapperObject

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