Class: Procmon::ProcessConditions::ProcessCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/procmon/process_conditions/process_condition.rb

Direct Known Subclasses

CpuUsage, MemUsage, ProcessHealth

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ProcessCondition

Returns a new instance of ProcessCondition.



5
6
7
8
# File 'lib/procmon/process_conditions/process_condition.rb', line 5

def initialize(options = {})
  @options = options
  @actions = options[:actions]
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



4
5
6
# File 'lib/procmon/process_conditions/process_condition.rb', line 4

def actions
  @actions
end

Instance Method Details

#check(value) ⇒ Object



14
15
16
# File 'lib/procmon/process_conditions/process_condition.rb', line 14

def check(value)
  raise "Implement in subclass!"
end

#descriptionObject



22
23
24
# File 'lib/procmon/process_conditions/process_condition.rb', line 22

def description
  raise "Implement in subclass!"
end

#format_value(value) ⇒ Object



18
19
20
# File 'lib/procmon/process_conditions/process_condition.rb', line 18

def format_value(value)
  value
end

#run(pid) ⇒ Object



10
11
12
# File 'lib/procmon/process_conditions/process_condition.rb', line 10

def run(pid)
  raise "Implement in subclass!"
end