123456789_123456789_123456789_123456789_123456789_

Class: Psych::ClassLoader::Restricted

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Psych::ClassLoader
Defined in: ext/psych/lib/psych/class_loader.rb

Constant Summary

::Psych::ClassLoader - Inherited

BIG_DECIMAL, CACHE, COMPLEX, DATE, DATE_TIME, EXCEPTION, OBJECT, PSYCH_OMAP, PSYCH_SET, RANGE, RATIONAL, REGEXP, STRUCT, SYMBOL

Class Method Summary

Instance Method Summary

::Psych::ClassLoader - Inherited

#path2class

Convert path string to a class.

#load, #symbolize, #find, #resolve

Constructor Details

.new(classes, symbols) ⇒ Restricted

[ GitHub ]

  
# File 'ext/psych/lib/psych/class_loader.rb', line 77

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 95

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 83

def symbolize sym
  return super if @symbols.empty?

  if @symbols.include? sym
    super
  else
    raise DisallowedClass, 'Symbol'
  end
end