Class: ProcessObserver::Process
- Inherits:
-
Object
- Object
- ProcessObserver::Process
- Defined in:
- lib/process_observer/process.rb
Overview
Class representing process.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#memory ⇒ Integer?
readonly
Memory amount of consumed memory.
-
#name ⇒ String
readonly
Name name of the executable or command.
-
#pid ⇒ Integer
readonly
Pid process ID.
Instance Method Summary collapse
-
#initialize(options) ⇒ Process
constructor
Initialize new process.
Constructor Details
#initialize(options) ⇒ Process
Initialize new process.
27 28 29 30 31 |
# File 'lib/process_observer/process.rb', line 27 def initialize() @name = [:image_name].to_s @pid = [:pid].to_i @memory = [:memory] ? [:memory].to_i : nil end |
Instance Attribute Details
#memory ⇒ Integer? (readonly)
Returns memory amount of consumed memory.
17 18 19 |
# File 'lib/process_observer/process.rb', line 17 def memory @memory end |
#name ⇒ String (readonly)
Returns name name of the executable or command.
9 10 11 |
# File 'lib/process_observer/process.rb', line 9 def name @name end |
#pid ⇒ Integer (readonly)
Returns pid process ID.
13 14 15 |
# File 'lib/process_observer/process.rb', line 13 def pid @pid end |