Class: Aws::Sigv4::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sigv4/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Returns a new instance of Request.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :http_method (required, String)
  • :endpoint (required, HTTP::URI, HTTPS::URI, String)
  • :headers (Hash<String,String>) — default: {}
  • :body (String, IO) — default: ''


11
12
13
14
15
16
17
18
19
# File 'lib/aws-sigv4/request.rb', line 11

def initialize(options = {})
  @http_method = nil
  @endpoint = nil
  @headers = {}
  @body = ''
  options.each_pair do |attr_name, attr_value|
    send("#{attr_name}=", attr_value)
  end
end

Instance Method Details

#bodyString, IO

Returns:

  • (String, IO)


57
58
59
# File 'lib/aws-sigv4/request.rb', line 57

def body
  @body
end

#body=(body) ⇒ Object

Parameters:

  • body (String, IO)


52
53
54
# File 'lib/aws-sigv4/request.rb', line 52

def body=(body)
  @body = body
end

#endpointHTTP::URI, HTTPS::URI

Returns:

  • (HTTP::URI, HTTPS::URI)


37
38
39
# File 'lib/aws-sigv4/request.rb', line 37

def endpoint
  @endpoint
end

#endpoint=(endpoint) ⇒ Object

Parameters:

  • endpoint (String, HTTP::URI, HTTPS::URI)


32
33
34
# File 'lib/aws-sigv4/request.rb', line 32

def endpoint=(endpoint)
  @endpoint = URI.parse(endpoint.to_s)
end

#headersHash<String,String>

Returns:

  • (Hash<String,String>)


47
48
49
# File 'lib/aws-sigv4/request.rb', line 47

def headers
  @headers
end

#headers=(headers) ⇒ Object

Parameters:

  • headers (Hash)


42
43
44
# File 'lib/aws-sigv4/request.rb', line 42

def headers=(headers)
  @headers = headers
end

#http_methodString

Returns One of ‘GET’, ‘PUT’, ‘POST’, ‘DELETE’, ‘HEAD’, or ‘PATCH’.

Returns:

  • (String)

    One of ‘GET’, ‘PUT’, ‘POST’, ‘DELETE’, ‘HEAD’, or ‘PATCH’



27
28
29
# File 'lib/aws-sigv4/request.rb', line 27

def http_method
  @http_method
end

#http_method=(http_method) ⇒ Object

Parameters:

  • http_method (String)

    One of ‘GET’, ‘PUT’, ‘POST’, ‘DELETE’, ‘HEAD’, or ‘PATCH’



22
23
24
# File 'lib/aws-sigv4/request.rb', line 22

def http_method=(http_method)
  @http_method = http_method
end