Class: Barthes::Client::Ace
- Defined in:
- lib/barthes/client/ace.rb
Constant Summary collapse
- OPTION_KEYS =
%w( authorization_key signature_method authorization_prefix service region host nonce access_key_id_key path use_ssl endpoint response_format http_method access_key_id secret_access_key timeout headers )
Instance Method Summary collapse
- #action(params) ⇒ Object
-
#initialize(env) ⇒ Ace
constructor
A new instance of Ace.
Methods inherited from HTTParty
#compare, #extract, #set_proxy, #xpath
Constructor Details
#initialize(env) ⇒ Ace
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/barthes/client/ace.rb', line 34 def initialize(env) # TODO: validate existence of required options = env.slice(*OPTION_KEYS).symbolize_keys [:http_method] = [:http_method].downcase.to_sym if [:http_method] if env['client'] && env['client']['user'] @user = env['client']['user'] [:access_key_id] = env["#{@user}.access_key_id"] [:secret_access_key] = env["#{@user}.secret_access_key"] end end |
Instance Method Details
#action(params) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/barthes/client/ace.rb', line 45 def action(params) params = params.dup action = params.delete('Action') params ||= {} response = @client.action(action, params) response end |