Class: Zm::Client::BatchRequest
- Inherits:
-
Object
- Object
- Zm::Client::BatchRequest
- Defined in:
- lib/zm/client/cluster/batch_request.rb
Constant Summary collapse
- ONERRORS =
%w[continue stop].freeze
Instance Attribute Summary collapse
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
Instance Method Summary collapse
-
#initialize(connector) ⇒ BatchRequest
constructor
A new instance of BatchRequest.
- #invoke(onerror: ONERRORS.first) ⇒ Object
Constructor Details
#initialize(connector) ⇒ BatchRequest
Returns a new instance of BatchRequest.
10 11 12 13 |
# File 'lib/zm/client/cluster/batch_request.rb', line 10 def initialize(connector) @connector = connector @requests = [] end |
Instance Attribute Details
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
8 9 10 |
# File 'lib/zm/client/cluster/batch_request.rb', line 8 def requests @requests end |
Instance Method Details
#invoke(onerror: ONERRORS.first) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/zm/client/cluster/batch_request.rb', line 15 def invoke(onerror: ONERRORS.first) return [] if @requests.empty? onerror = ONERRORS.first unless ONERRORS.include?(onerror) soap_resp = @connector.invoke(build(onerror))[:BatchResponse] @requests.clear format_response(soap_resp) end |