Class: PSTree::ProcStruct
- Inherits:
-
Object
- Object
- PSTree::ProcStruct
- Defined in:
- lib/pstree.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#ppid ⇒ Object
readonly
Returns the value of attribute ppid.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(ppid, pid, user, cmd) ⇒ ProcStruct
constructor
A new instance of ProcStruct.
- #to_s ⇒ Object
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
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
9 10 11 |
# File 'lib/pstree.rb', line 9 def cmd @cmd end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
9 10 11 |
# File 'lib/pstree.rb', line 9 def pid @pid end |
#ppid ⇒ Object (readonly)
Returns the value of attribute ppid.
9 10 11 |
# File 'lib/pstree.rb', line 9 def ppid @ppid end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
9 10 11 |
# File 'lib/pstree.rb', line 9 def user @user end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/pstree.rb', line 11 def to_s "%05u %s (%s)" % [ pid, cmd, user ] end |