module Truck::Autoloader::HandleConstMissing

Public Instance Methods

handle(*args) click to toggle source
# File lib/truck/autoloader.rb, line 91
def handle(*args)
  found_const = catch :const do
    handle! *args and return NullModule
  end
  throw :const, found_const
rescue NameError => name_error; raise name_error
ensure
  unset_current_autoloader if found_const or name_error
end
handle!(const_name, from, current_file = nil) click to toggle source
# File lib/truck/autoloader.rb, line 101
def handle!(const_name, from, current_file = nil)
  autoloader = current_autoloader || new(from, current_file)
  autoloader << String(const_name)
  set_current_autoloader autoloader
end