Class: Psych::ClassLoader

Inherits:
Object show all
Defined in:
lib/psych/class_loader.rb,
psych_to_ruby.c

Overview

:nodoc:

Direct Known Subclasses

Restricted

Defined Under Namespace

Classes: Restricted

Constant Summary collapse

BIG_DECIMAL =
'BigDecimal'
COMPLEX =
'Complex'
DATE =
'Date'
DATE_TIME =
'DateTime'
EXCEPTION =
'Exception'
OBJECT =
'Object'
PSYCH_OMAP =
'Psych::Omap'
PSYCH_SET =
'Psych::Set'
RANGE =
'Range'
RATIONAL =
'Rational'
REGEXP =
'Regexp'
STRUCT =
'Struct'
SYMBOL =
'Symbol'

Instance Method Summary collapse

Constructor Details

#initializeClassLoader

Returns a new instance of ClassLoader



20
21
22
# File 'lib/psych/class_loader.rb', line 20

def initialize
  @cache = CACHE.dup
end

Instance Method Details

#load(klassname) ⇒ Object



24
25
26
27
28
# File 'lib/psych/class_loader.rb', line 24

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

  find klassname
end

#symbolize(sym) ⇒ Object



30
31
32
33
# File 'lib/psych/class_loader.rb', line 30

def symbolize sym
  symbol
  sym.to_sym
end