class Psych::Visitors::Visitor
def self.dispatch_cache
- Api: - private
def self.dispatch_cache Hash.new do |hash, klass| hash[klass] = :"visit_#{klass.name.gsub('::', '_')}" end.compare_by_identity end
def accept target
def accept target visit target end
def dispatch
def dispatch @dispatch_cache ||= (Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache) end
def dispatch
def dispatch DISPATCH end
def visit target
def visit target send dispatch[target.class], target end