Class: WitBot::WitRequestSender

Inherits:
Object
  • Object
show all
Defined in:
lib/wit_bot/requests/wit_request_sender.rb

Instance Method Summary collapse

Constructor Details

#initializeWitRequestSender

Returns a new instance of WitRequestSender.



4
5
6
7
8
9
10
# File 'lib/wit_bot/requests/wit_request_sender.rb', line 4

def initialize
  @http = HTTP[
                Accept: "application/vnd.wit.#{WitBot.config.version}+json",
                Authorization: "Bearer #{WitBot.config.token}"
              ]
              .persistent(WitBot.config.host)
end

Instance Method Details

#closeObject



14
15
16
# File 'lib/wit_bot/requests/wit_request_sender.rb', line 14

def close
  @http.close
end

#httpObject



11
12
13
# File 'lib/wit_bot/requests/wit_request_sender.rb', line 11

def http
  @http
end