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 +4 -4
- data/README.md +26 -0
- data/lib/stream/feed.rb +3 -2
- data/lib/stream/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f98b8b58d796c88411770e8527cf42e744a8eb1321ba195a26320021d1697788
|
4
|
+
data.tar.gz: e2e4bc61511e1847cc9b1ff7130f44e4b07106a3e652da677124e6104c6b9bcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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, {},
|
68
|
+
@client.make_request(:post, uri, auth_token, {}, data)
|
68
69
|
end
|
69
70
|
|
70
71
|
def add_activities(activities)
|
data/lib/stream/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|