Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Psych::Visitors::ToRuby#resolve_subclass

resolve_subclass(klassname, parent)

Resolve klassname and ensure it is parent or one of its subclasses. Tags such as !ruby/hash-with-ivars are only ever emitted for subclasses of a specific core class; without this check a crafted document could name an unrelated (but permitted) class and have its state populated directly, bypassing the class’s own init_with.