Class: Procfs2::ProcPid

Inherits:
ProcModule show all
Defined in:
lib/procfs2/proc_pid.rb

Constant Summary collapse

LABEL =
:pid

Instance Attribute Summary collapse

Attributes inherited from ProcItem

#_data, #_parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ProcModule

provide

Methods inherited from ProcItem

#_path, #_raw_content

Constructor Details

#initialize(pid:, parent:) ⇒ ProcPid

Returns a new instance of ProcPid.



12
13
14
15
# File 'lib/procfs2/proc_pid.rb', line 12

def initialize(pid:, parent:)
  @pid = pid
  super(parent: parent)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Procfs2::ProcItem

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



10
11
12
# File 'lib/procfs2/proc_pid.rb', line 10

def pid
  @pid
end

Class Method Details

.build(pid, parent:) ⇒ Object



24
25
26
# File 'lib/procfs2/proc_pid.rb', line 24

def build(pid, parent:)
  new(pid: pid, parent: parent)
end

Instance Method Details

#_filenameObject



17
18
19
# File 'lib/procfs2/proc_pid.rb', line 17

def _filename
  pid.to_s
end