Class: Telegram::Bot::Botan::Api

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/telegram/bot/botan/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Api

Returns a new instance of Api.



11
12
13
# File 'lib/telegram/bot/botan/api.rb', line 11

def initialize(token)
  @token = token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/telegram/bot/botan/api.rb', line 7

def token
  @token
end

Instance Method Details

#track(event, uid, properties = {}) ⇒ Object



15
16
17
18
19
# File 'lib/telegram/bot/botan/api.rb', line 15

def track(event, uid, properties = {})
  self.class.post('/track',
                  query: { token: token, name: event, uid: uid },
                  body: properties.to_json)
end