Class: SimpleAWS::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_aws/core/connection.rb

Overview

Handles all communication to and from AWS itself

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ Connection


61
62
63
# File 'lib/simple_aws/core/connection.rb', line 61

def initialize(api)
  @api = api
end

Instance Method Details

#call(request) ⇒ Object

Send an SimpleAWS::Request to AWS proper, returning an SimpleAWS::Response. Will raise if the request has an error


69
70
71
72
73
74
75
76
77
78
79
# File 'lib/simple_aws/core/connection.rb', line 69

def call(request)
  SimpleAWS::Response.new(
    HTTP.send(request.method,
      request.uri,
      :query => request.params,
      :headers => request.headers,
      :body => request.body,
      :debug_output => @api.debug_to
    )
  )
end