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, #do_retry, #error, #execute, #process_response, #set_api_version_header, #success
Methods included from Logging
Constructor Details
#initialize(method, url) ⇒ BatchCommand
Returns a new instance of BatchCommand.
48 49 50 51 52 |
# File 'lib/google/apis/core/batch.rb', line 48 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.
60 61 62 63 64 |
# File 'lib/google/apis/core/batch.rb', line 60 def add(call, &block) ensure_valid_command(call) @calls << [call, block] self end |