Class: PsProcess

Inherits:
Hash
  • Object
show all
Defined in:
lib/ps-ruby/ps-ruby.rb

Instance Method Summary collapse

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/ps-ruby/ps-ruby.rb', line 8

def alive?
  PS.get_all_processes.pick_attr("PID").include?(self["PID"])
end

#kill!Object



4
5
6
# File 'lib/ps-ruby/ps-ruby.rb', line 4

def kill!
  `kill #{self["PID"]}`
end