Class: Proc::Http::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/proc/http/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method:, uri:, params:, headers:, body:) ⇒ Request

Returns a new instance of Request.



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

def initialize(method:, uri:, params:, headers:, body:)
  @method = method
  @uri = uri
  @params = params
  @headers = headers
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



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

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



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

def method
  @method
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#uriObject (readonly)

Returns the value of attribute uri.



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

def uri
  @uri
end

Instance Method Details

#callableObject



16
17
18
# File 'lib/proc/http/request.rb', line 16

def callable
  [@method.to_s.upcase, finalize_uri(@uri, @params), @headers, @body]
end