Class: Sys::Proc

Inherits:
Object
  • Object
show all
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

VERSION =
Version.new.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Concern::System

included, #system

Methods included from Concern::StaticInstance

included

Constructor Details

#initialize(system = nil) ⇒ Proc

Returns a new instance of Proc.

Parameters:

  • system (String|Symbol) (defaults to: nil)


38
39
40
# File 'lib/sys/proc.rb', line 38

def initialize(system = nil)
  @system = system
end

Class Method Details

.methodsArray<Symbol>

Get available methods

Returns:

  • (Array<Symbol>)


46
47
48
# File 'lib/sys/proc.rb', line 46

def methods
  super() + new.methods
end

.public_methodsArray<Symbol>

Get available public methods

Returns:

  • (Array<Symbol>)


53
54
55
# File 'lib/sys/proc.rb', line 53

def public_methods
  super() + new.public_methods
end

Instance Method Details

#pidObject



58
59
60
# File 'lib/sys/proc.rb', line 58

def pid
  $PROCESS_ID
end

#timeFloat

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