Class: MixpanelTyphoeus

Inherits:
MonsterMash::Base
  • Object
show all
Defined in:
lib/mixpanel_typhoeus.rb,
lib/mixpanel_typhoeus/support.rb

Defined Under Namespace

Modules: Support

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.tokenObject

Returns the value of attribute token.



6
7
8
# File 'lib/mixpanel_typhoeus.rb', line 6

def token
  @token
end

Class Method Details

.check_for_unique_id!(properties) ⇒ Object



34
35
36
37
38
39
# File 'lib/mixpanel_typhoeus.rb', line 34

def self.check_for_unique_id!(properties)
  if !properties.has_key?(:ip) && !properties.has_key?('ip') &&
      !properties.has_key?(:distinct_id) && !properties.has_key?('distinct_id')
    raise ArgumentError, "Mixpanel requires you to pass either the 'ip' property or 'distinct_id', for a unique ID."
  end
end

.encode_data(params = {}) ⇒ Object



29
30
31
32
# File 'lib/mixpanel_typhoeus.rb', line 29

def self.encode_data(params = {})
  json = JSON.generate(params)
  Support.encode64s(json)
end