Class: Sys::Proc
- Inherits:
-
Object
- Object
- Sys::Proc
- Includes:
- Concern::StaticInstance, Concern::System
- Defined in:
- lib/sys/proc.rb,
lib/sys/proc.rb
Overview
Operations on current process
Defined Under Namespace
Modules: Concern, System Classes: Helper, Version
Constant Summary collapse
Class Method Summary collapse
-
.methods ⇒ Array<Symbol>
Get available methods.
-
.public_methods ⇒ Array<Symbol>
Get available public methods.
Instance Method Summary collapse
-
#initialize(system = nil) ⇒ Proc
constructor
A new instance of Proc.
- #pid ⇒ Object
-
#time ⇒ Float
Time in seconds since system boot.
Methods included from Concern::System
Methods included from Concern::StaticInstance
Constructor Details
#initialize(system = nil) ⇒ Proc
Returns a new instance of Proc.
38 39 40 |
# File 'lib/sys/proc.rb', line 38 def initialize(system = nil) @system = system end |
Class Method Details
.methods ⇒ Array<Symbol>
Get available methods
46 47 48 |
# File 'lib/sys/proc.rb', line 46 def methods super() + new.methods end |
.public_methods ⇒ Array<Symbol>
Get available public methods
53 54 55 |
# File 'lib/sys/proc.rb', line 53 def public_methods super() + new.public_methods end |
Instance Method Details
#pid ⇒ Object
58 59 60 |
# File 'lib/sys/proc.rb', line 58 def pid $PROCESS_ID end |
#time ⇒ Float
Time in seconds since system boot
66 67 68 |
# File 'lib/sys/proc.rb', line 66 def time Process.clock_gettime(Process::CLOCK_MONOTONIC) end |