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.
Instance Method Details
#add_to_many(activity_data, feeds) ⇒ nil
Adds an activity to many feeds in one single request
35 36 37 38 39 40 41 |
# File 'lib/stream/batch.rb', line 35 def add_to_many(activity_data, feeds) data = { :feeds => feeds, :activity => activity_data } make_signed_request(:post, '/feed/add_to_many/', {}, data) end |
#follow_many(follows, activity_copy_limit = nil) ⇒ nil
Follows many feeds in one single request
follows = [
{:source => 'flat:1', :target => 'user:1'},
{:source => 'flat:1', :target => 'user:3'}
] @client.follow_many(follows)
19 20 21 22 23 24 25 |
# File 'lib/stream/batch.rb', line 19 def follow_many(follows, activity_copy_limit = nil) query_params = {} unless activity_copy_limit.nil? query_params['activity_copy_limit'] = activity_copy_limit end make_signed_request(:post, '/follow_many/', query_params, follows) end |