class Psych::ClassLoader

:nodoc:

def find klassname

def find klassname
  @cache[klassname] ||= resolve(klassname)
end

def initialize

def initialize
  @cache = CACHE.dup
end

def load klassname

def load klassname
  return nil if !klassname || klassname.empty?
  find klassname
end

def resolve klassname

def resolve klassname
  name    = klassname
  retried = false
  begin
    path2class(name)
  rescue ArgumentError, NameError => ex
    unless retried
      name    = "Struct::#{name}"
      retried = ex
      retry
    end
    raise retried
  end
end

def symbolize sym

def symbolize sym
  symbol
  sym.to_sym
end