Class: BotAPI::Auth
- Inherits:
-
Object
- Object
- BotAPI::Auth
- Defined in:
- lib/telegram_bot_builder/bot_api.rb
Instance Method Summary collapse
- #auth ⇒ Object
-
#initialize ⇒ Auth
constructor
A new instance of Auth.
Constructor Details
#initialize ⇒ Auth
84 85 86 |
# File 'lib/telegram_bot_builder/bot_api.rb', line 84 def initialize #return auth end |
Instance Method Details
#auth ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/telegram_bot_builder/bot_api.rb', line 88 def auth method = 'getMe' uri = URI.parse(URLBUIDER.build(method)) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true result = http.get(uri.request_uri) if result.code == "200" object = BotAPI.parse(method, result.body) return object end end |