klaviyo 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/klaviyo.gemspec +2 -2
  2. data/lib/klaviyo/client.rb +3 -3
  3. metadata +2 -2
data/klaviyo.gemspec CHANGED
@@ -2,8 +2,8 @@ files = ['klaviyo.gemspec', '{lib}/**/*'].map {|f| Dir[f]}.flatten
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'klaviyo'
5
- s.version = '0.9.1'
6
- s.date = '2012-07-11'
5
+ s.version = '0.9.2'
6
+ s.date = '2012-09-03'
7
7
  s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API'
8
8
  s.description = 'Ruby wrapper for the Klaviyo API'
9
9
  s.authors = ['Andrew Bialecki']
@@ -7,14 +7,13 @@ module Klaviyo
7
7
  class KlaviyoError < StandardError; end
8
8
 
9
9
  class Client
10
- def initialize(api_key, env, url = 'http://a.klaviyo.com/')
10
+ def initialize(api_key, url = 'http://a.klaviyo.com/')
11
11
  @api_key = api_key
12
- @env = env
13
12
  @url = url
14
13
  end
15
14
 
16
15
  def track(event, kwargs = {})
17
- defaults = {:id => nil, :email => nil, :properties => {}, :customer_properties => {}}
16
+ defaults = {:id => nil, :email => nil, :properties => {}, :customer_properties => {}, :time => nil}
18
17
  kwargs = defaults.merge(kwargs)
19
18
 
20
19
  if kwargs[:email].to_s.empty? and kwargs[:id].to_s.empty?
@@ -30,6 +29,7 @@ module Klaviyo
30
29
  :event => event,
31
30
  :properties => kwargs[:properties],
32
31
  :customer_properties => customer_properties,
32
+ :time => time.to_i,
33
33
  :ip => ''
34
34
  })
35
35
  request('crm/api/track', params)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaviyo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-11 00:00:00.000000000 Z
12
+ date: 2012-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json