stream-ruby 2.9.0 → 2.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stream/activities.rb +25 -8
- 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: f2af3c27be5bdebb32976858a5d0197e8b11f422997ef59377b998a9059f7dcd
|
4
|
+
data.tar.gz: 4cbc46a5fec2bd1b69c94a4eac7bdf6949e4c8bc85cc277f34e567fa77ade514
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 937bd12b5586efca7d2055ea97b121d44b38c4bb0394a2f33156a172aa1185d78f6c1e20dfa60badbc588c02f19b5e18f7f19235f19f73ebf2eb134c6bc1a9e8
|
7
|
+
data.tar.gz: f6123bf2238f01d3be9ff911d17da7cadbeb2ed8bf905335476b37a5ab3dc00034407d2845be3ef660486a0735c791ccbab959d805f9ed0a4d21d7bde583c039
|
data/lib/stream/activities.rb
CHANGED
@@ -4,23 +4,40 @@ module Stream
|
|
4
4
|
#
|
5
5
|
# Get activities directly, via ID or Foreign ID + timestamp
|
6
6
|
#
|
7
|
-
# @param [Hash<:ids, :
|
7
|
+
# @param [Hash<:ids, :foreign_id_times>] params the request params (ids or list of <:foreign_id, :time> objects)
|
8
8
|
#
|
9
9
|
# @return the found activities, if any.
|
10
10
|
#
|
11
11
|
# @example
|
12
12
|
#
|
13
13
|
#
|
14
|
-
# @client.get_activities(
|
15
|
-
# ids: [
|
16
|
-
#
|
14
|
+
# @client.get_activities(
|
15
|
+
# ids: [
|
16
|
+
# '4b39fda2-d6e2-42c9-9abf-5301ef071b12',
|
17
|
+
# '89b910d3-1ef5-44f8-914e-e7735d79e817'
|
18
|
+
# ]
|
19
|
+
# )
|
17
20
|
#
|
18
|
-
# @client.get_activities(
|
19
|
-
#
|
20
|
-
#
|
21
|
-
# }
|
21
|
+
# @client.get_activities(
|
22
|
+
# foreign_id_times: [
|
23
|
+
# { foreign_id: 'post:1000', time: '2016-11-10T13:20:00.000000' },
|
24
|
+
# { foreign_id: 'like:2000', time: '2018-01-07T09:15:59.123456' }
|
25
|
+
# ]
|
26
|
+
# )
|
22
27
|
#
|
23
28
|
def get_activities(params = {})
|
29
|
+
if params[:foreign_id_times]
|
30
|
+
foreign_ids = []
|
31
|
+
timestamps = []
|
32
|
+
params[:foreign_id_times].each{|e|
|
33
|
+
foreign_ids << e[:foreign_id]
|
34
|
+
timestamps << e[:time]
|
35
|
+
}
|
36
|
+
params = {
|
37
|
+
foreign_ids: foreign_ids,
|
38
|
+
timestamps: timestamps,
|
39
|
+
}
|
40
|
+
end
|
24
41
|
signature = Stream::Signer.create_jwt_token('activities', '*', @api_secret, '*')
|
25
42
|
make_request(:get, '/activities/', signature, params)
|
26
43
|
end
|
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.1
|
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-
|
13
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|