Sha256: 08688f09366cfebb32f930ce35f5eecb2dec0034fa428199ff0ca1c875bc830c

Contents?: true

Size: 996 Bytes

Versions: 17

Compression:

Stored size: 996 Bytes

Contents

# frozen_string_literal: false
module Psych
  module Nodes
    ###
    # 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.
    class Stream < Psych::Nodes::Node

      # Encodings supported by Psych (and libyaml)

      # Any encoding
      ANY     = Psych::Parser::ANY

      # UTF-8 encoding
      UTF8    = Psych::Parser::UTF8

      # UTF-16LE encoding
      UTF16LE = Psych::Parser::UTF16LE

      # UTF-16BE encoding
      UTF16BE = Psych::Parser::UTF16BE

      # The encoding used for this stream
      attr_accessor :encoding

      ###
      # Create a new Psych::Nodes::Stream node with an +encoding+ that
      # defaults to Psych::Nodes::Stream::UTF8.
      #
      # See also Psych::Handler#start_stream
      def initialize encoding = UTF8
        super()
        @encoding = encoding
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
psych-3.0.0.beta2-java lib/psych/nodes/stream.rb
psych-3.0.0.beta2 lib/psych/nodes/stream.rb
psych-2.2.4-java lib/psych/nodes/stream.rb
psych-2.2.4 lib/psych/nodes/stream.rb
psych-2.2.3-java lib/psych/nodes/stream.rb
psych-2.2.3 lib/psych/nodes/stream.rb
ruby-compiler-0.1.1 vendor/ruby/ext/psych/lib/psych/nodes/stream.rb
psych-2.2.2-java lib/psych/nodes/stream.rb
psych-2.2.2 lib/psych/nodes/stream.rb
psych-2.2.1-java lib/psych/nodes/stream.rb
psych-2.2.1 lib/psych/nodes/stream.rb
psych-2.2.0-java lib/psych/nodes/stream.rb
psych-2.2.0 lib/psych/nodes/stream.rb
psych-2.1.1-java lib/psych/nodes/stream.rb
psych-2.1.1 lib/psych/nodes/stream.rb
psych-2.1.0-java lib/psych/nodes/stream.rb
psych-2.1.0 lib/psych/nodes/stream.rb