Class: Google::Apis::Core::BatchCommand
- Inherits:
-
HttpCommand
- Object
- HttpCommand
- Google::Apis::Core::BatchCommand
- Defined in:
- lib/google/apis/core/batch.rb
Overview
Wrapper request for batching multiple calls in a single server request
Direct Known Subclasses
Constant Summary collapse
- MULTIPART_MIXED =
'multipart/mixed'
Constants inherited from HttpCommand
Instance Attribute Summary
Attributes inherited from HttpCommand
#body, #connection, #header, #method, #options, #params, #query, #url
Instance Method Summary collapse
-
#add(call) {|result, err| ... } ⇒ Google::Apis::Core::BatchCommand
Add a new call to the batch request.
-
#initialize(method, url) ⇒ BatchCommand
constructor
A new instance of BatchCommand.
Methods inherited from HttpCommand
#allow_form_encoding?, #apply_request_options, #authorization_refreshable?, #check_status, #error, #execute, #process_response, #success
Methods included from Logging
Constructor Details
#initialize(method, url) ⇒ BatchCommand
Returns a new instance of BatchCommand.
47 48 49 50 51 |
# File 'lib/google/apis/core/batch.rb', line 47 def initialize(method, url) super(method, url) @calls = [] @base_id = SecureRandom.uuid end |
Instance Method Details
#add(call) {|result, err| ... } ⇒ Google::Apis::Core::BatchCommand
Add a new call to the batch request.
59 60 61 62 63 |
# File 'lib/google/apis/core/batch.rb', line 59 def add(call, &block) ensure_valid_command(call) @calls << [call, block] self end |