123456789_123456789_123456789_123456789_123456789_

Class: Psych::Visitors::DepthFirst

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Visitor
Instance Chain:
self, Visitor
Inherits: Psych::Visitors::Visitor
Defined in: ext/psych/lib/psych/visitors/depth_first.rb

Constant Summary

Visitor - Inherited

DISPATCH

Class Method Summary

Instance Method Summary

Visitor - Inherited

Constructor Details

.new(block) ⇒ DepthFirst

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 4

def initialize block
  @block = block
end

Instance Method Details

#nary(o) (private) Also known as: #visit_Psych_Nodes_Stream, #visit_Psych_Nodes_Document, #visit_Psych_Nodes_Sequence, #visit_Psych_Nodes_Mapping

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 10

def nary o
  o.children.each { |x| visit x }
  @block.call o
end

#terminal(o) (private) Also known as: #visit_Psych_Nodes_Scalar, #visit_Psych_Nodes_Alias

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 19

def terminal o
  @block.call o
end

#visit_Psych_Nodes_Alias(o) (private)

Alias for #terminal.

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 23

alias :visit_Psych_Nodes_Alias  :terminal

#visit_Psych_Nodes_Document(o) (private)

Alias for #nary.

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 15

alias :visit_Psych_Nodes_Document :nary

#visit_Psych_Nodes_Mapping(o) (private)

Alias for #nary.

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 17

alias :visit_Psych_Nodes_Mapping  :nary

#visit_Psych_Nodes_Scalar(o) (private)

Alias for #terminal.

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 22

alias :visit_Psych_Nodes_Scalar :terminal

#visit_Psych_Nodes_Sequence(o) (private)

Alias for #nary.

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 16

alias :visit_Psych_Nodes_Sequence :nary

#visit_Psych_Nodes_Stream(o) (private)

Alias for #nary.

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/depth_first.rb', line 14

alias :visit_Psych_Nodes_Stream   :nary