Class: MiniCheck::ChecksCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/mini_check/checks_collection.rb

Instance Method Summary collapse

Instance Method Details

#healthy?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/mini_check/checks_collection.rb', line 7

def healthy?
  all?(&:healthy?)
end

#register(name, &block) ⇒ Object



15
16
17
# File 'lib/mini_check/checks_collection.rb', line 15

def register name, &block
  push(Check.new(name, &block))
end

#runObject



11
12
13
# File 'lib/mini_check/checks_collection.rb', line 11

def run
  each(&:run)
end

#to_hashObject



3
4
5
# File 'lib/mini_check/checks_collection.rb', line 3

def to_hash
  Hash[map { |check| [check.name, check.to_hash] }]
end