Class: BetterCap::Loader

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

Overview

This class is responsible for dynamically loading modules.

Class Method Summary collapse

Class Method Details

.load(name) ⇒ Object

Dynamically load a class given its name.


15
16
17
18
19
20
21
# File 'lib/bettercap/loader.rb', line 15

def self.load(name)
  root = Kernel
  name.split('::').each do |part|
    root = root.const_get(part)
  end
  root
end