intercom 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4283247105b0839f88ceccb190267097afc7a811
4
- data.tar.gz: 82c9527868644929a6df8449a738815eef91a848
3
+ metadata.gz: 39ff3f29f239b7890f520cf8218ba43d271d4923
4
+ data.tar.gz: ac6433a1f09441a1c060f066530df24cfa32cb00
5
5
  SHA512:
6
- metadata.gz: cf0d49c2e3d446f37ee45a0896efa479caa196927a6439fd100210c3236bb680fa89df935330540d42178cb32316e73a25eb286ed8803dfc3289a69ce60c3bd6
7
- data.tar.gz: 5710c4604f076ad7e5ffadb6f54aab2f0c8d99d9666b9e37bf6b7c9b28c465dcdd46bff2b722fc38714ec3515b51de4f5e3f077c467205555a6144e6b0d6c20d
6
+ metadata.gz: d9d4ad05c27d11cc40499894bad90bb88450cfe6cfee6ad39ff9a5ac9c025ceab6683b58ffd883085c4302f19c9e6773b226e7ed3027df3f9a4c15527d839402
7
+ data.tar.gz: f8c9665740085e86ee5fe6787f754cc2b539e0f7c576df1f55f920c8c3cbfd43bd2721768791c720aaa3795c4c58ef8f35b432edb9eecbdae61319040a201154
data/lib/intercom/user.rb CHANGED
@@ -338,11 +338,11 @@ module Intercom
338
338
 
339
339
  ##
340
340
  # Creates a UserEvent for the given User
341
- # @param {Hash} options, keys for :created (Unix timestamp) and :company_id (String)
341
+ # @param {Hash} options, keys for :created_at (Unix timestamp) and metadata
342
342
  def log_event(event_name, options={})
343
343
  attributes = {:event_name => event_name, :user => self}
344
- attributes[:created] = options[:created] unless options[:created].nil?
345
- attributes[:company_id] = options[:company_id] unless options[:company_id].nil?
344
+ attributes[:created_at] = options[:created_at] unless options[:created_at].nil?
345
+ attributes[:metadata] = options[:metadata] unless options[:metadata].nil?
346
346
  UserEvent.create(attributes)
347
347
  end
348
348
 
@@ -12,13 +12,13 @@ module Intercom
12
12
  #
13
13
  # == Examples
14
14
  #
15
- # user_event = Intercom::UserEvent.create(:event_name => "post", :user => current_user, :created => Time.now)
15
+ # user_event = Intercom::UserEvent.create(:event_name => "post", :user => current_user, :created_at => Time.now)
16
16
  #
17
17
  # You can also create an user-event and save it like this:
18
18
  # user_event = Intercom::UserEvent.new
19
19
  # user_event.event_name = "publish-post"
20
20
  # user_event.user = current_user
21
- # user_event.created = Time.now
21
+ # user_event.created_at = Time.now
22
22
  # user_event.metadata = {
23
23
  # :title => 'Gravity Review',
24
24
  # :link => 'https://example.org/posts/22',
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -268,7 +268,7 @@ describe "Intercom::User" do
268
268
  Intercom::UserEvent.expects(:create).with(:event_name => 'registration', :user => user)
269
269
  event = user.log_event('registration')
270
270
 
271
- Intercom::UserEvent.expects(:create).with(:event_name => 'another', :user => user, :created => 1391691571, :company_id => "6")
272
- event = user.log_event("another", {:created => 1391691571, :company_id => "6"})
271
+ Intercom::UserEvent.expects(:create).with(:event_name => 'another', :user => user, :created_at => 1391691571)
272
+ event = user.log_event("another", {:created_at => 1391691571})
273
273
  end
274
274
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intercom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McRedmond