lib/ace-client/base.rb in ace-client-0.0.4 vs lib/ace-client/base.rb in ace-client-0.0.5

- old
+ new

@@ -2,10 +2,11 @@ require 'uri' module AceClient class Base include HTTParty + ssl_version :SSLv3 attr_accessor :access_key_id attr_accessor :secret_access_key attr_accessor :endpoint attr_accessor :http_proxy @@ -14,13 +15,13 @@ attr_accessor :last_response attr_accessor :last_response_time attr_accessor :user_agent def initialize(options) - @access_key_id = options[:access_key_id] - @secret_access_key = options[:secret_access_key] - @endpoint = options[:endpoint] - @http_proxy = options[:http_proxy] + @access_key_id = options[:access_key_id] || ENV['ACE_ACCESS_KEY_ID'] + @secret_access_key = options[:secret_access_key] || ENV['ACE_SECRET_ACCESS_KEY'] + @endpoint = options[:endpoint] || ENV['ACE_ENDPOINT'] + @http_proxy = options[:http_proxy] || ENV['HTTP_PROXY'] @http_method = options[:http_method] || :post @use_ssl = options[:use_ssl] || true @version = options[:version] @path = options[:path] || '/' @user_agent = options[:user_agent]