Sha256: 40f96e3a061c49e733f4e6ee2f4bdf7f03d02870b4764fabee784aad01a14265

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

module MiniCheck
  class ChecksCollection < Array
    def to_hash
      resp = {}
      each.map do |check|
        resp[check.name] = check.to_hash
      end

      resp
    end

    def healthy?
      !detect{|c| !c.healthy? }
    end

    def run
      each{|c| c.run }
    end
    
    def register name, &block
      self.<< Check.new(name, &block)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mini_check-0.1.1 lib/mini_check/checks_collection.rb
mini_check-0.1.0 lib/mini_check/checks_collection.rb