module Pico::Autoloader::HandleConstMissing

Public Instance Methods

handle(*args) click to toggle source
# File lib/pico/autoloader.rb, line 87
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
  set_current_autoloader(to: nil) if found_const or name_error
end
handle!(const_name, from:) click to toggle source
# File lib/pico/autoloader.rb, line 97
def handle!(const_name, from:)
  autoloader = current_autoloader || new(from)
  autoloader << String(const_name)
  set_current_autoloader to: autoloader
end