Module: Stream::Batch
- Included in:
- Client
- Defined in:
- lib/stream/batch.rb
Instance Method Summary collapse
-
#add_to_many(activity_data, feeds) ⇒ nil
Adds an activity to many feeds in one single request.
-
#follow_many(follows, activity_copy_limit = nil) ⇒ nil
Follows many feeds in one single request.
-
#unfollow_many(unfollows) ⇒ Object
Unfollow many feeds in one single request.
Instance Method Details
#add_to_many(activity_data, feeds) ⇒ nil
Adds an activity to many feeds in one single request
51 52 53 54 55 56 57 58 |
# File 'lib/stream/batch.rb', line 51 def add_to_many(activity_data, feeds) data = { feeds: feeds, activity: activity_data } signature = Stream::Signer.create_jwt_token('feed', '*', @api_secret, '*') make_request(:post, '/feed/add_to_many/', signature, {}, data) end |
#follow_many(follows, activity_copy_limit = nil) ⇒ nil
Follows many feeds in one single request
17 18 19 20 21 22 |
# File 'lib/stream/batch.rb', line 17 def follow_many(follows, activity_copy_limit = nil) query_params = {} query_params['activity_copy_limit'] = activity_copy_limit unless activity_copy_limit.nil? signature = Stream::Signer.create_jwt_token('follower', '*', @api_secret, '*') make_request(:post, '/follow_many/', signature, query_params, follows) end |
#unfollow_many(unfollows) ⇒ Object
Unfollow many feeds in one single request
return [nil]
38 39 40 41 |
# File 'lib/stream/batch.rb', line 38 def unfollow_many(unfollows) signature = Stream::Signer.create_jwt_token('follower', '*', @api_secret, '*') make_request(:post, '/unfollow_many/', signature, {}, unfollows) end |