Sha256: 4dce2fdafa47301266387b55af18f6b2fabeeef1a843a7a8e21f5b2bc2a7ca9f
Contents?: true
Size: 599 Bytes
Versions: 7
Compression:
Stored size: 599 Bytes
Contents
module Ecoportal module API module Common class BatchResponse attr_reader :status, :body, :result def initialize(status, body, result = nil) @status = status @body = body @result = result end def success? (0..299).include?(status) end def each [*@result].each do |doc| yield doc end end def print if success? each(&:print) else puts "Request failed." end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems