lib/ecoportal/api/common/batch_response.rb in ecoportal-api-0.9.7 vs lib/ecoportal/api/common/batch_response.rb in ecoportal-api-0.10.0
- old
+ new
@@ -1,10 +1,9 @@
module Ecoportal
module API
module Common
class BatchResponse
-
attr_reader :status, :body, :result
def initialize(status, body, result = nil)
@status = HTTP::Response::Status.new(status)
@body = body
@@ -13,13 +12,11 @@
def success?
status.success?
end
- def each
- [*@result].each do |doc|
- yield doc
- end
+ def each(&block)
+ [*@result].each(&block)
end
def print_pretty
if success?
each(&:print_pretty)