Class: Virgil::SDK::Client::HTTP::Request

Inherits:
Struct
  • Object
show all
Defined in:
lib/virgil/sdk/client/http/request.rb

Overview

Http request wrapper.

Attributes:

endpoint: request endpoint
body: request body
headers: dict of request additional headers
method: http request method

Constant Summary collapse

GET =
:get
POST =
:post
PUT =
:put
DELETE =
:delete

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Request

Constructs new Request object.



48
49
50
51
52
53
# File 'lib/virgil/sdk/client/http/request.rb', line 48

def initialize(attributes)
  self.endpoint = attributes[:endpoint]
  self.body = attributes[:body]
  self.headers = attributes[:headers]
  self.method = attributes[:method]
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



46
47
48
# File 'lib/virgil/sdk/client/http/request.rb', line 46

def body
  @body
end

#endpointObject

Returns the value of attribute endpoint

Returns:

  • (Object)

    the current value of endpoint



46
47
48
# File 'lib/virgil/sdk/client/http/request.rb', line 46

def endpoint
  @endpoint
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



46
47
48
# File 'lib/virgil/sdk/client/http/request.rb', line 46

def headers
  @headers
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



46
47
48
# File 'lib/virgil/sdk/client/http/request.rb', line 46

def method
  @method
end