1. Psych::
  2. Nodes::
  3. Node

class Psych::Nodes::Node

The base class for anyNode in aYAML parse tree. This class should never be instantiated.

Attributes

children[R]

The children of this node

end_column[RW]

The column number where this node ends

end_line[RW]

The line number where this node ends

start_column[RW]

The column number where this node start

start_line[RW]

The line number where this node start

tag[R]

An associated tag

Public Class Methods

Source
# File ext/psych/lib/psych/nodes/node.rb, line 32definitialize@children = []end

Create a newPsych::Nodes::Node

Public Instance Methods

Source
# File ext/psych/lib/psych/nodes/node.rb, line 68defalias?;false;end
Source
# File ext/psych/lib/psych/nodes/node.rb, line 69defdocument?;false;end
Source
# File ext/psych/lib/psych/nodes/node.rb, line 39defeach&blockreturnenum_for:eachunlessblock_given?Visitors::DepthFirst.new(block).acceptselfend

Iterate over each node in the tree. Yields each node toblock depth first.

Source
# File ext/psych/lib/psych/nodes/node.rb, line 70defmapping?;false;end
Source
# File ext/psych/lib/psych/nodes/node.rb, line 71defscalar?;false;end
Source
# File ext/psych/lib/psych/nodes/node.rb, line 72defsequence?;false;end
Source
# File ext/psych/lib/psych/nodes/node.rb, line 73defstream?;false;end
Source
# File ext/psych/lib/psych/nodes/node.rb, line 48defto_ruby(symbolize_names:false,freeze:false,strict_integer:false)Visitors::ToRuby.create(symbolize_names:symbolize_names,freeze:freeze,strict_integer:strict_integer).accept(self)end

Convert this node to Ruby.

See alsoPsych::Visitors::ToRuby

Also aliased as:transform
Alias for:yaml
Alias for:to_ruby
Source
# File ext/psych/lib/psych/nodes/node.rb, line 57defyamlio =nil,options = {}require"stringio"unlessdefined?(StringIO)real_io =io||StringIO.new(''.encode('utf-8'))Visitors::Emitter.new(real_io,options).acceptselfreturnreal_io.stringunlessioioend

Convert this node toYAML.

See alsoPsych::Visitors::Emitter

Also aliased as:to_yaml