類別 Psych::Visitors::Visitor
常數
- DISPATCH
非公開類別方法
dispatch_cache() 按一下以切換來源
@api private
# File ext/psych/lib/psych/visitors/visitor.rb, line 12 def self.dispatch_cache Hash.new do |hash, klass| hash[klass] = :"visit_#{klass.name.gsub('::', '_')}" end.compare_by_identity end
公開實例方法
accept(target) 按一下以切換來源
# File ext/psych/lib/psych/visitors/visitor.rb, line 5 def accept target visit target end
非公開實例方法
dispatch() 按一下以切換來源
# File ext/psych/lib/psych/visitors/visitor.rb, line 19 def dispatch @dispatch_cache ||= (Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache) end
visit(target) 按一下以切換來源
# File ext/psych/lib/psych/visitors/visitor.rb, line 29 def visit target send dispatch[target.class], target end