Class: Bot::Analytics

Inherits:
Object
  • Object
show all
Defined in:
lib/bot/analytics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_key, mixpanel = false) ⇒ Analytics

Returns a new instance of Analytics.



7
8
9
10
# File 'lib/bot/analytics.rb', line 7

def initialize(user_key, mixpanel=false)
  @mixpanel = mixpanel
  @user_key = user_key
end

Instance Attribute Details

#mixpanelObject

Returns the value of attribute mixpanel.



5
6
7
# File 'lib/bot/analytics.rb', line 5

def mixpanel
  @mixpanel
end

#user_keyObject

Returns the value of attribute user_key.



5
6
7
# File 'lib/bot/analytics.rb', line 5

def user_key
  @user_key
end

Instance Method Details

#track(event, options = {}) ⇒ Object



12
13
14
# File 'lib/bot/analytics.rb', line 12

def track(event, options={})
  mixpanel.track(user_key, event, options) if mixpanel
end