Class: TelegramBotApi::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram_bot_api/http_client.rb

Class Method Summary collapse

Class Method Details

.make_request(verb:, url:, params:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/telegram_bot_api/http_client.rb', line 6

def self.make_request(verb:, url:, params:)
  method = case verb
  when :get
    :get
  when :post
    :post
  end

  unless method
    raise(ArgumentError, "Invalid verb")
  end

  self.send(method, url: url, params: params)
end