Sha256: ee79e4be06c1b79cb4b23706c54d93fbd085fc95ec58dec926935983b7618ca4
Contents?: true
Size: 636 Bytes
Versions: 6
Compression:
Stored size: 636 Bytes
Contents
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 @result = result end def success? status.success? end def each [*@result].each do |doc| yield doc end end def pretty_print if success? each(&:pretty_print) else puts "Request failed." end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems