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.


19
20
21
22
23
24
25
# File 'lib/bettercap/loader.rb', line 19

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