simple_segment 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47f4f7b0de0d4bf9985f3a4d479fdbbe9a4e1348
4
- data.tar.gz: f826f5d41f0e0bcd4e73bf7c387abd217511b6dd
3
+ metadata.gz: 00dfcaba81c53815a6cc8f837b9fe8e8a832abb7
4
+ data.tar.gz: 7c2f9c23df74413679b4dce401d7f0f8d1cfb2a6
5
5
  SHA512:
6
- metadata.gz: 039f22d6d9008b18da395ed169ae1498e4f06d875ced8114da315f25be3389ecb876156f2548a8364073d4cab3d7ec768c8a7c143e7625a9a7d8e76e54f2c469
7
- data.tar.gz: 7198dcfdd23555625149dd5709b6ba5c844a6d6508c5dbd00e87564d335e7029aee8dd5aac2140982f76a29374bef14cf834fb70249d1a6e54884f296dabdc9d
6
+ metadata.gz: 46211a605c9107ff3b960278c3d10227e0cf1388c25a4ad10551709cc7e88a3ab04bd559c4c9a04e840cde5e943c8d1423511bbc557cdd41469b3467b0892243
7
+ data.tar.gz: 5015cffb0a7100bba692ae9023bc083c49dcd7993c4b41ee1cbdccdba7a515f32d9eb4b6ec88530535eeca71ba29f6eb29fdfef69886c5f1cd51cbf061b6c7db
@@ -30,7 +30,7 @@ module SimpleSegment
30
30
  anonymousId: options[:anonymous_id],
31
31
  context: DEFAULT_CONTEXT.merge(options[:context].to_h),
32
32
  integrations: options[:integrations],
33
- timestamp: options.fetch(:timestamp, current_time).iso8601,
33
+ timestamp: timestamp(options.fetch(:timestamp, current_time)),
34
34
  sentAt: current_time.iso8601
35
35
  }
36
36
  end
@@ -40,6 +40,14 @@ module SimpleSegment
40
40
  raise ArgumentError, 'user_id or anonymous_id must be present'
41
41
  end
42
42
  end
43
+
44
+ def timestamp(timestamp)
45
+ if timestamp.respond_to?(:iso8601)
46
+ timestamp.iso8601
47
+ else
48
+ Time.iso8601(timestamp).iso8601
49
+ end
50
+ end
43
51
  end
44
52
  end
45
53
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleSegment
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_segment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Topolskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-25 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler