Class: Updawg::DeviationCheck
- Defined in:
- lib/updawg/checks/deviation_check.rb
Instance Attribute Summary
Attributes inherited from Check
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ DeviationCheck
constructor
A new instance of DeviationCheck.
- #scale_factor ⇒ Object
- #smoothing ⇒ Object
Methods inherited from Check
#error, #error!, #pass, #pass!, #perform, #warning, #warning!
Constructor Details
#initialize(name, options = {}, &block) ⇒ DeviationCheck
Returns a new instance of DeviationCheck.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/updawg/checks/deviation_check.rb', line 5 def initialize(name, = {}, &block) super(name, , &block) unknown_keys = .keys - [ :deviates_high, :deviates_low, :scale_factor, :smoothing, :unless_below, :unless_above ].flatten raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty? @options = @scale_factor = .fetch(:scale_factor, 2) @smoothing = .fetch(:smoothing, true) end |
Instance Method Details
#scale_factor ⇒ Object
18 19 20 |
# File 'lib/updawg/checks/deviation_check.rb', line 18 def scale_factor @scale_factor end |
#smoothing ⇒ Object
22 23 24 |
# File 'lib/updawg/checks/deviation_check.rb', line 22 def smoothing @smoothing end |