Class: Boechat::Core::Service::Request
- Inherits:
-
Object
- Object
- Boechat::Core::Service::Request
- Defined in:
- lib/boechat/core/service/request.rb
Overview
Class responsible for make the request to one service
Constant Summary collapse
- HTTP_UNPROCESSABLE_ENTITY =
422
- BASIC_HEADER =
{ 'User-Agent' => 'Boechat - API Version Verifier' }
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#service_uri ⇒ Object
readonly
Returns the value of attribute service_uri.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(service_uri, verb: :get, parameters: nil, body: nil, headers: nil) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(service_uri, verb: :get, parameters: nil, body: nil, headers: nil) ⇒ Request
Returns a new instance of Request.
20 21 22 23 24 25 26 27 28 |
# File 'lib/boechat/core/service/request.rb', line 20 def initialize(service_uri, verb: :get, parameters: nil, body: nil, headers: nil) @service_uri = service_uri @verb = verb @parameters = parameters @body = body @headers = headers @request = Typhoeus::Request.new(@service_uri, method: @verb, params: @parameters, body: @body, headers: http_header) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def headers @headers end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def parameters @parameters end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def response @response end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def result @result end |
#service_uri ⇒ Object (readonly)
Returns the value of attribute service_uri.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def service_uri @service_uri end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
16 17 18 |
# File 'lib/boechat/core/service/request.rb', line 16 def verb @verb end |
Instance Method Details
#call ⇒ Object
30 31 32 |
# File 'lib/boechat/core/service/request.rb', line 30 def call handle_request end |