????JFIF??x?x????'
| Server IP : 172.67.174.47 / Your IP : 216.73.216.87 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/./self/root/opt/alt/ruby21/lib64/ruby/2.1.0/psych/nodes/ |
Upload File : |
require 'stringio'
require 'psych/class_loader'
require 'psych/scalar_scanner'
module Psych
module Nodes
###
# The base class for any Node in a YAML parse tree. This class should
# never be instantiated.
class Node
include Enumerable
# The children of this node
attr_reader :children
# An associated tag
attr_reader :tag
# Create a new Psych::Nodes::Node
def initialize
@children = []
end
###
# Iterate over each node in the tree. Yields each node to +block+ depth
# first.
def each &block
return enum_for :each unless block_given?
Visitors::DepthFirst.new(block).accept self
end
###
# Convert this node to Ruby.
#
# See also Psych::Visitors::ToRuby
def to_ruby
Visitors::ToRuby.create.accept(self)
end
alias :transform :to_ruby
###
# Convert this node to YAML.
#
# See also Psych::Visitors::Emitter
def yaml io = nil, options = {}
real_io = io || StringIO.new(''.encode('utf-8'))
Visitors::Emitter.new(real_io, options).accept self
return real_io.string unless io
io
end
alias :to_yaml :yaml
end
end
end