| Server IP : 181.215.205.78 / Your IP : 216.73.216.146 Web Server : LiteSpeed System : Linux srv028146260 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64 User : situs1068 ( 1161) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/ruby/3.0.0/psych/nodes/ |
Upload File : |
# frozen_string_literal: true
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
# The line number where this node start
attr_accessor :start_line
# The column number where this node start
attr_accessor :start_column
# The line number where this node ends
attr_accessor :end_line
# The column number where this node ends
attr_accessor :end_column
# 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(symbolize_names: false, freeze: false)
Visitors::ToRuby.create(symbolize_names: symbolize_names, freeze: freeze).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
def alias?; false; end
def document?; false; end
def mapping?; false; end
def scalar?; false; end
def sequence?; false; end
def stream?; false; end
end
end
end