0

Where is the origin of Process.new and where is it doccumented? I have looked in the Ruby docs at the process module and I cannot figure out how this is declared.

The code I am trying to replicate is in the Ruby God gem in lib/god/conditions/memory_usage.rb:66:

process = System::Process.new(self.pid)
@timeline.push(process.memory)
Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
BookOfGreg
  • 3,550
  • 2
  • 42
  • 56

1 Answers1

2

System::Process isn't part of Ruby, it comes from God (the gem) itself. You can view its source if you want.

It's referable as System::Process in the file you reference because you're already in the God module, so Ruby resolves it within that namespace.

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214