Module: AsyncRack::ExtensionMixin

Extended by:
ExtensionMixin
Included in:
ExtensionMixin, Session
Defined in:
lib/async_rack.rb

Instance Method Summary collapse

Instance Method Details

#autoload(class_name, path) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/async_rack.rb', line 15

def autoload(class_name, path)
  mod = Rack
  mod_path = self.name.split("::")
  mod_path.shift
  while (mod_ = mod_path.shift)
    mod = mod.const_get(mod_.to_sym)
  end
  # already loaded ? override.
  if mod.autoload?(class_name) == nil
    require path
  else
    mod.autoload class_name, path
    super
  end
end