lib/mixpanel/mixpanel.rb in mixpanel-0.6.1 vs lib/mixpanel/mixpanel.rb in mixpanel-0.7.0

- old
+ new

@@ -8,12 +8,16 @@ @env = env clear_queue end def append_event(event, properties = {}) - queue << build_event(event, properties) + append_api('track', event, properties) end - + + def append_api(type, *args) + queue << [type, args.map {|arg| arg.to_json}] + end + def track_event(event, properties = {}) params = build_event(event, properties.merge(:token => @token, :time => Time.now.utc.to_i, :ip => ip)) parse_response request(params) end