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

Version Path
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/lib/psych/visitors/visitor.rb
cybrid_api_bank_ruby-0.123.12 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_organization_ruby-0.123.12 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_id_ruby-0.123.12 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_bank_ruby-0.123.11 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_organization_ruby-0.123.11 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_id_ruby-0.123.11 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_id_ruby-0.123.10 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_bank_ruby-0.123.10 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_organization_ruby-0.123.10 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_organization_ruby-0.123.7 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_id_ruby-0.123.7 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_bank_ruby-0.123.7 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
ory-client-1.15.12 vendor/bundle/ruby/3.1.0/gems/psych-4.0.6/lib/psych/visitors/visitor.rb
cybrid_api_bank_ruby-0.123.4 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_id_ruby-0.123.4 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_organization_ruby-0.123.4 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_bank_ruby-0.123.3 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_organization_ruby-0.123.3 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb
cybrid_api_id_ruby-0.123.3 vendor/bundle/ruby/3.3.0/gems/psych-5.2.0/lib/psych/visitors/visitor.rb