Class: Ticketbai::Api::Client
- Inherits:
-
Object
- Object
- Ticketbai::Api::Client
- Defined in:
- lib/ticketbai/api/client.rb
Constant Summary collapse
- KO_RESPONSE =
:incorrecto
- OK_RESPONSE =
:correcto
- PARTIALLY_OK_RESPONSE =
:parcialmentecorrecto
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(url:, headers:, body:, company_cert:) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(url:, headers:, body:, company_cert:) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 |
# File 'lib/ticketbai/api/client.rb', line 8 def initialize(url:, headers:, body:, company_cert:) @url = url @headers = headers @body = body @company_cert = company_cert end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/ticketbai/api/client.rb', line 15 def execute response = connection.post do |req| req.url(@url) req.headers = @headers req.body = @body end ResponseParser.new(response).to_h end |