Class: Virgil::SDK::Client::HTTP::Request
- Inherits:
-
Struct
- Object
- Struct
- Virgil::SDK::Client::HTTP::Request
- 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
-
#body ⇒ Object
Returns the value of attribute body.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Request
constructor
Constructs new Request object.
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
#body ⇒ Object
Returns the value of attribute body
46 47 48 |
# File 'lib/virgil/sdk/client/http/request.rb', line 46 def body @body end |
#endpoint ⇒ Object
Returns the value of attribute endpoint
46 47 48 |
# File 'lib/virgil/sdk/client/http/request.rb', line 46 def endpoint @endpoint end |
#headers ⇒ Object
Returns the value of attribute headers
46 47 48 |
# File 'lib/virgil/sdk/client/http/request.rb', line 46 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method
46 47 48 |
# File 'lib/virgil/sdk/client/http/request.rb', line 46 def method @method end |