Sha256: aa9a5bd802b4f383c38d24de727d9de2181accfa2b671dc9a37b548f5492e6de

Contents?: true

Size: 627 Bytes

Versions: 17

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: false
module Psych
  module Visitors
    class DepthFirst < Psych::Visitors::Visitor
      def initialize block
        @block = block
      end

      private

      def nary o
        o.children.each { |x| visit x }
        @block.call o
      end
      alias :visit_Psych_Nodes_Stream   :nary
      alias :visit_Psych_Nodes_Document :nary
      alias :visit_Psych_Nodes_Sequence :nary
      alias :visit_Psych_Nodes_Mapping  :nary

      def terminal o
        @block.call o
      end
      alias :visit_Psych_Nodes_Scalar :terminal
      alias :visit_Psych_Nodes_Alias  :terminal
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
psych-3.0.0.beta2-java lib/psych/visitors/depth_first.rb
psych-3.0.0.beta2 lib/psych/visitors/depth_first.rb
psych-2.2.4-java lib/psych/visitors/depth_first.rb
psych-2.2.4 lib/psych/visitors/depth_first.rb
psych-2.2.3-java lib/psych/visitors/depth_first.rb
psych-2.2.3 lib/psych/visitors/depth_first.rb
ruby-compiler-0.1.1 vendor/ruby/ext/psych/lib/psych/visitors/depth_first.rb
psych-2.2.2-java lib/psych/visitors/depth_first.rb
psych-2.2.2 lib/psych/visitors/depth_first.rb
psych-2.2.1-java lib/psych/visitors/depth_first.rb
psych-2.2.1 lib/psych/visitors/depth_first.rb
psych-2.2.0-java lib/psych/visitors/depth_first.rb
psych-2.2.0 lib/psych/visitors/depth_first.rb
psych-2.1.1-java lib/psych/visitors/depth_first.rb
psych-2.1.1 lib/psych/visitors/depth_first.rb
psych-2.1.0-java lib/psych/visitors/depth_first.rb
psych-2.1.0 lib/psych/visitors/depth_first.rb