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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: becda7571b74f9aafa3184c2886c46aad9e832c10254a44c6399d5579ddd1877
4
- data.tar.gz: 00de69a0e93425085d4d6e0efa9851edb982167449d580845b831c7d3c4696ca
3
+ metadata.gz: f2af3c27be5bdebb32976858a5d0197e8b11f422997ef59377b998a9059f7dcd
4
+ data.tar.gz: 4cbc46a5fec2bd1b69c94a4eac7bdf6949e4c8bc85cc277f34e567fa77ade514
5
5
  SHA512:
6
- metadata.gz: 5686b82d209f7c743aea82dcc286c84a836e3379747e8beba35be9b652954b1a47d1240b000fc4ec546a3dabb354062426d7b4352410d36e296897a63a768c3c
7
- data.tar.gz: a34dff05a28d11d42184b9d7e27322686686fef374a37c9c9475dcbd26e5edb7cbce554ce1ac1b44524fb3b4c39bcc5fd9f550cb061f9d5d843f9933b6d44cff
6
+ metadata.gz: 937bd12b5586efca7d2055ea97b121d44b38c4bb0394a2f33156a172aa1185d78f6c1e20dfa60badbc588c02f19b5e18f7f19235f19f73ebf2eb134c6bc1a9e8
7
+ data.tar.gz: f6123bf2238f01d3be9ff911d17da7cadbeb2ed8bf905335476b37a5ab3dc00034407d2845be3ef660486a0735c791ccbab959d805f9ed0a4d21d7bde583c039
@@ -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, :foreign_ids, :timestamps>] params the request params (ids or foreign_ids + timestamps)
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: [ '4b39fda2-d6e2-42c9-9abf-5301ef071b12', '89b910d3-1ef5-44f8-914e-e7735d79e817' ]
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
- # foreign_ids: [ 'post:1000', 'like:2000' ]
20
- # timestamps: [ '2016-11-10T13:20:00.000000', '2018-01-07T09:15:59.123456' ]
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
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = '2.9.0'.freeze
2
+ VERSION = '2.9.1'.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.0
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-11 00:00:00.000000000 Z
13
+ date: 2018-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday