Class: Psych::ClassLoader::Restricted
- Inherits:
-
Psych::ClassLoader
- Object
- Psych::ClassLoader
- Psych::ClassLoader::Restricted
- Defined in:
- lib/psych/class_loader.rb
Constant Summary
Constants inherited from Psych::ClassLoader
BIG_DECIMAL, COMPLEX, DATE, DATE_TIME, EXCEPTION, OBJECT, PSYCH_OMAP, PSYCH_SET, RANGE, RATIONAL, REGEXP, STRUCT, SYMBOL
Instance Method Summary collapse
-
#initialize(classes, symbols) ⇒ Restricted
constructor
A new instance of Restricted.
- #symbolize(sym) ⇒ Object
Methods inherited from Psych::ClassLoader
Constructor Details
#initialize(classes, symbols) ⇒ Restricted
Returns a new instance of Restricted.
77 78 79 80 81 |
# File 'lib/psych/class_loader.rb', line 77 def initialize classes, symbols @classes = classes @symbols = symbols super() end |
Instance Method Details
#symbolize(sym) ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/psych/class_loader.rb', line 83 def symbolize sym return super if @symbols.empty? if @symbols.include? sym super else raise DisallowedClass, 'Symbol' end end |