Sha256: 6d9f497d1c64d788203cc27b6fe13102ab7c230995b9c2a3d35918b3b7de09d3
Contents?: true
Size: 441 Bytes
Versions: 9
Compression:
Stored size: 441 Bytes
Contents
module Bidu module House class Status attr_reader :reports def initialize(reports) @reports = reports end def status reports.any? { |r| r.error? } ? :error : :ok end def as_json { status: status }.merge(reports_jsons) end private def reports_jsons reports.map(&:as_json).as_hash(reports.map(&:id)) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems