Class: Updawg::ThresholdCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/updawg/checks/threshold_check.rb

Instance Attribute Summary

Attributes inherited from Check

#name

Instance Method Summary collapse

Methods inherited from Check

#error, #error!, #pass, #pass!, #perform, #warning, #warning!

Constructor Details

#initialize(name, options = {}, &block) ⇒ ThresholdCheck

Returns a new instance of ThresholdCheck.

Raises:

  • (ArgumentError)


3
4
5
6
7
8
9
10
# File 'lib/updawg/checks/threshold_check.rb', line 3

def initialize(name, options = {}, &block)
  super(name, options, &block)
  
  unknown_keys = options.keys - [:error_under, :error_over, :warning_under, :warning_over].flatten
  raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty?

  @options = options
end