Permalink
Browse files

refactors Storage#initialize method

  • Loading branch information...
1 parent 967810d commit a62da482aa026948ea0033b9966b33aeb0ca8629 @mateuszzawisza committed Feb 11, 2012
Showing with 2 additions and 8 deletions.
  1. +2 −8 lib/savior/storage.rb
View
@@ -3,14 +3,8 @@
class Savior
class Storage
def initialize(options={})
- default_options = {
- :access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
- :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY'],
- :bucket_name => nil
- }
- options = default_options.merge(options)
- @access_key_id = options[:access_key_id]
- @secret_access_key = options[:secret_access_key]
+ @access_key_id = options[:access_key_id] || ENV['AMAZON_ACCESS_KEY_ID']
+ @secret_access_key = options[:secret_access_key] || ENV['AMAZON_SECRET_ACCESS_KEY']
@bucket_name = options[:bucket_name]
@s3 = AWS::S3.new(
:access_key_id => @access_key_id,

0 comments on commit a62da48

Please sign in to comment.