Class: PSTree::ProcStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/pstree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ppid, pid, user, cmd) ⇒ ProcStruct

Returns a new instance of ProcStruct.



5
6
7
# File 'lib/pstree.rb', line 5

def initialize(ppid, pid, user, cmd)
  @ppid, @pid, @user, @cmd = ppid.to_i, pid.to_i, user, cmd
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



9
10
11
# File 'lib/pstree.rb', line 9

def cmd
  @cmd
end

#pidObject (readonly)

Returns the value of attribute pid.



9
10
11
# File 'lib/pstree.rb', line 9

def pid
  @pid
end

#ppidObject (readonly)

Returns the value of attribute ppid.



9
10
11
# File 'lib/pstree.rb', line 9

def ppid
  @ppid
end

#userObject (readonly)

Returns the value of attribute user.



9
10
11
# File 'lib/pstree.rb', line 9

def user
  @user
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/pstree.rb', line 11

def to_s
 "%05u %s (%s)" % [ pid, cmd, user ]
end