class Psych::Nodes::Stream - Documentation for Ruby 4.0
Description: class Psych::Nodes::Stream: Represents a YAML stream. This is the root node for any YAML parse tree.
Keywords: ruby,class,Psych::Nodes::Stream

🔍

No recent searches

# class Psych::Nodes::Stream

Represents a `YAML` stream. This is the root node for any `YAML` parse tree. This node must have one or more child nodes. The only valid child node for a `Psych::Nodes::Stream` node is `Psych::Nodes::Document`.

### Constants

ANY

  Any encoding

UTF16BE

  UTF-16BE encoding

UTF16LE

  UTF-16LE encoding

UTF8

  UTF-8 encoding

### Attributes

encoding [RW]

The encoding used for this stream

### Public Class Methods

new (encoding = UTF8)
Source

    # File ext/psych/lib/psych/nodes/stream.rb, line 32
    def initialize encoding = UTF8
      super()
      @encoding = encoding
    end

Create a new `Psych::Nodes::Stream` node with an `encoding` that defaults to `Psych::Nodes::Stream::UTF8`.

See also `Psych::Handler#start_stream`

Calls superclass method `Psych::Nodes::Node::new`

### Public Instance Methods

stream? ()
Source

    # File ext/psych/lib/psych/nodes/stream.rb, line 37
    def stream?; true; end