Class: Psych::ClassLoader

Inherits:
Object show all
Defined in:
lib/psych/class_loader.rb,
ext/psych/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.



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

def initialize
  @cache = CACHE.dup
end

Instance Method Details

#load(klassname) ⇒ Object



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

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

  find klassname
end

#symbolize(sym) ⇒ Object



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

def symbolize sym
  symbol
  sym.to_sym
end