Class: Remon::ProcCheck
Constant Summary
Constants inherited from Check
Check::CRITICAL, Check::OK, Check::WARNING
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Check
Instance Method Summary collapse
- #check_name ⇒ Object
-
#initialize(name, pr) ⇒ ProcCheck
constructor
A new instance of ProcCheck.
- #run ⇒ Object
- #to_s ⇒ Object
Methods inherited from Check
get_opts, name, name=, opts, #run_mutex
Methods included from Logger
Constructor Details
#initialize(name, pr) ⇒ ProcCheck
Returns a new instance of ProcCheck.
6 7 8 9 10 11 |
# File 'lib/remon/proc_check.rb', line 6 def initialize(name, pr) raise "no proc passed" if not pr.is_a?(Proc) @name = name @pr = pr @mutex = Mutex.new end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/remon/proc_check.rb', line 5 def name @name end |
Instance Method Details
#check_name ⇒ Object
17 18 19 |
# File 'lib/remon/proc_check.rb', line 17 def check_name @name end |
#run ⇒ Object
13 14 15 |
# File 'lib/remon/proc_check.rb', line 13 def run instance_eval &@pr end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/remon/proc_check.rb', line 21 def to_s "<proc:#{@name}>" end |