stream-ruby 2.9.2 → 2.9.3

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
  SHA256:
3
- metadata.gz: aa3fd8416479a3f83b76be9af897b7bef40a6a0770d6ac45be99b75a82b7aedd
4
- data.tar.gz: 1ab6edc954bf604be1a09b3111363d0ad32c266a2ae7557972ab316921f0400b
3
+ metadata.gz: f98b8b58d796c88411770e8527cf42e744a8eb1321ba195a26320021d1697788
4
+ data.tar.gz: e2e4bc61511e1847cc9b1ff7130f44e4b07106a3e652da677124e6104c6b9bcc
5
5
  SHA512:
6
- metadata.gz: 7b5f504fc53c67a6f6e9a759277febf2455a1d4d5d043f874195476416eec4d210904d6968822ccf4a3e39f07bf2cce09cbc4bfc1ff10db2d113054102032b3b
7
- data.tar.gz: 28e9529d57a99eaaf637f8ffe9cef98e13d480d7cd983d954f3ab9e2a0a4293e030c2dc0faadf3a3ad395ce56aac63024b5b23e8cb0a33349781156490a280c7
6
+ metadata.gz: e76f57de1bf59425e296a30d83399a2a274f1a65bbd444919d1015c379e6e05585db8a4f0693faa910e1a2747c864c99e0e52738350802b4ddb7fb8fd5656976
7
+ data.tar.gz: 114a26054d265d538fe36f6f1e83fe20051bf1c17fba36394121a4dc4fbd9a6d40bfd45fb9fca164587d4fef2abb45759f524b957c1fd4656ed8e1c168e3bf18
data/README.md CHANGED
@@ -103,6 +103,32 @@ user_feed_1.add_activity(data)
103
103
  # Remove a feed and its content
104
104
  user_feed_1.delete
105
105
 
106
+ # Updating parts of an activity
107
+ set = {
108
+ 'product.price': 19.99,
109
+ 'shares': {
110
+ 'facebook': '...',
111
+ 'twitter': '...'
112
+ },
113
+ }
114
+ unset = [
115
+ 'daily_likes',
116
+ 'popularity'
117
+ ]
118
+ # ...by ID
119
+ client.activity_partial_update(
120
+ id: '54a60c1e-4ee3-494b-a1e3-50c06acb5ed4',
121
+ set: set,
122
+ unset: unset,
123
+ )
124
+ # ...or by combination of foreign ID and time
125
+ client.activity_partial_update(
126
+ foreign_id: 'product:123',
127
+ time: '2016-11-10T13:20:00.000000',
128
+ set: set,
129
+ unset: unset,
130
+ )
131
+
106
132
  # Generating tokens for client side usage
107
133
  token = user_feed_1.readonly_token
108
134
 
data/lib/stream/feed.rb CHANGED
@@ -61,10 +61,11 @@ module Stream
61
61
 
62
62
  def add_activity(activity_data)
63
63
  uri = "/feed/#{@feed_url}/"
64
- activity_data[:to] &&= sign_to_field(activity_data[:to])
64
+ data = activity_data.clone
65
+ data[:to] &&= sign_to_field(data[:to])
65
66
  auth_token = create_jwt_token('feed', 'write')
66
67
 
67
- @client.make_request(:post, uri, auth_token, {}, activity_data)
68
+ @client.make_request(:post, uri, auth_token, {}, data)
68
69
  end
69
70
 
70
71
  def add_activities(activities)
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = '2.9.2'.freeze
2
+ VERSION = '2.9.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.2
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommaso Barbugli
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-07-24 00:00:00.000000000 Z
13
+ date: 2018-08-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday