Class: RestfulResource::Request

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, url, headers: {}, body: nil, open_timeout: nil, timeout: nil) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
10
11
12
# File 'lib/restful_resource/request.rb', line 5

def initialize(method, url, headers: {}, body: nil, open_timeout: nil, timeout: nil)
  @method = method
  @url = url
  @headers = headers
  @body = body
  @open_timeout = open_timeout
  @timeout = timeout
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/restful_resource/request.rb', line 3

def body
  @body
end

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/restful_resource/request.rb', line 3

def method
  @method
end

#open_timeoutObject (readonly)

Returns the value of attribute open_timeout.



3
4
5
# File 'lib/restful_resource/request.rb', line 3

def open_timeout
  @open_timeout
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



3
4
5
# File 'lib/restful_resource/request.rb', line 3

def timeout
  @timeout
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/restful_resource/request.rb', line 3

def url
  @url
end

Instance Method Details

#headersObject



14
15
16
# File 'lib/restful_resource/request.rb', line 14

def headers
  default_headers.merge(format_headers)
end