Class: Psych::ClassLoader::Restricted
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::Psych::ClassLoader
|
|
Instance Chain:
self,
::Psych::ClassLoader
|
|
Inherits: |
Psych::ClassLoader
|
Defined in: | ext/psych/lib/psych/class_loader.rb |
Class Method Summary
- .new(classes, symbols) ⇒ Restricted constructor
Instance Method Summary
- #symbolize(sym)
- #find(klassname) private
::Psych::ClassLoader - Inherited
#path2class | Convert |
Constructor Details
.new(classes, symbols) ⇒ Restricted
# File 'ext/psych/lib/psych/class_loader.rb', line 75
def initialize classes, symbols @classes = classes @symbols = symbols super() end
Instance Method Details
#find(klassname) (private)
[ GitHub ]# File 'ext/psych/lib/psych/class_loader.rb', line 93
def find klassname if @classes.include? klassname super else raise DisallowedClass, klassname end end
#symbolize(sym)
[ GitHub ]# File 'ext/psych/lib/psych/class_loader.rb', line 81
def symbolize sym return super if @symbols.empty? if @symbols.include? sym super else raise DisallowedClass, 'Symbol' end end