Class: Telegram::Bot::Botan::Api
- Inherits:
-
Object
- Object
- Telegram::Bot::Botan::Api
- Defined in:
- lib/telegram/bot/botan/api.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ Api
constructor
A new instance of Api.
- #track(event, uid, properties = {}) ⇒ Object
Constructor Details
#initialize(token) ⇒ Api
7 8 9 |
# File 'lib/telegram/bot/botan/api.rb', line 7 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
5 6 7 |
# File 'lib/telegram/bot/botan/api.rb', line 5 def token @token end |
Instance Method Details
#track(event, uid, properties = {}) ⇒ Object
11 12 13 14 |
# File 'lib/telegram/bot/botan/api.rb', line 11 def track(event, uid, properties = {}) query_str = URI.encode_www_form(token: token, name: event, uid: uid) conn.post("/track?#{query_str}", properties.to_json) end |