Module: MixpanelRails::ClassMethods

Defined in:
lib/mixpanel_rails.rb

Instance Method Summary collapse

Instance Method Details

#uses_mixpanel(args = {}) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/mixpanel_rails.rb', line 17

def uses_mixpanel(args = {})
  cattr_accessor :mixpanel_distinct_id, :mixpanel_name_tag
  self.mixpanel_distinct_id = args[:distinct_id] || lambda {}
  self.mixpanel_name_tag = args[:name_tag] || lambda {}
  include MixpanelRails::InstanceMethods
  after_filter :process_mixpanel_queue
end