Class: Procfs2::ProcModule

Inherits:
ProcItem show all
Defined in:
lib/procfs2/proc_module.rb

Direct Known Subclasses

Proc, ProcNet, ProcPid

Instance Attribute Summary

Attributes inherited from ProcItem

#_data, #_parent

Class Method Summary collapse

Methods inherited from ProcItem

#_filename, #_path, #_raw_content, build, #initialize

Constructor Details

This class inherits a constructor from Procfs2::ProcItem

Dynamic Method Handling

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

Class Method Details

.provide(component, as: nil) ⇒ Object



8
9
10
11
12
13
# File 'lib/procfs2/proc_module.rb', line 8

def provide(component, as: nil)
  component_label = as || component::LABEL
  define_method component_label do |*args, **kwargs|
    component.build(*args, parent: self, **kwargs)
  end
end