Sha256: 22eb6b08e4ec1abb6e0495d7d51241f4fe6b5c4e87a3a49ea3ecc3ef01e90870
Contents?: true
Size: 702 Bytes
Versions: 6230
Compression:
Stored size: 702 Bytes
Contents
# frozen_string_literal: true module Psych module Visitors class Visitor def accept target visit target end private # @api private def self.dispatch_cache Hash.new do |hash, klass| hash[klass] = :"visit_#{klass.name.gsub('::', '_')}" end.compare_by_identity end if defined?(Ractor) def dispatch @dispatch_cache ||= (Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache) end else DISPATCH = dispatch_cache def dispatch DISPATCH end end def visit target send dispatch[target.class], target end end end end
Version data entries
6,230 entries across 6,227 versions & 23 rubygems