Class: DPay::HTTP::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/dpay/http/request.rb,
sig/dpay/http/request.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, url, headers = {}, body = nil) ⇒ Request

Returns a new instance of Request.

Parameters:

  • method (String)
  • url (String)
  • headers (Hash[String, String]) (defaults to: {})
  • body (String, nil) (defaults to: nil)


8
9
10
11
12
13
14
# File 'lib/dpay/http/request.rb', line 8

def initialize(method, url, headers = {}, body = nil)
  @method = method
  @url = url
  @headers = headers.freeze
  @body = body
  freeze
end

Instance Attribute Details

#bodyString? (readonly)

Returns the value of attribute body.

Returns:

  • (String, nil)


6
7
8
# File 'lib/dpay/http/request.rb', line 6

def body
  @body
end

#headersHash[String, String] (readonly)

Returns the value of attribute headers.

Returns:

  • (Hash[String, String])


6
7
8
# File 'lib/dpay/http/request.rb', line 6

def headers
  @headers
end

#methodString (readonly)

Returns the value of attribute method.

Returns:

  • (String)


6
7
8
# File 'lib/dpay/http/request.rb', line 6

def method
  @method
end

#urlString (readonly)

Returns the value of attribute url.

Returns:

  • (String)


6
7
8
# File 'lib/dpay/http/request.rb', line 6

def url
  @url
end