Sha256: 05d309201bba5d005064a71e41ed258d2fb99c3a428dd4f499abaf61d5feb9a2

Contents?: true

Size: 637 Bytes

Versions: 103

Compression:

Stored size: 637 Bytes

Contents

module Psych
  module Streaming
    module ClassMethods
      ###
      # Create a new streaming emitter.  Emitter will print to +io+.  See
      # Psych::Stream for an example.
      def new io
        emitter      = const_get(:Emitter).new(io)
        class_loader = ClassLoader.new
        ss           = ScalarScanner.new class_loader
        super(emitter, ss, {})
      end
    end

    ###
    # Start streaming using +encoding+
    def start encoding = Nodes::Stream::UTF8
      super.tap { yield self if block_given?  }
    ensure
      finish if block_given?
    end

    private
    def register target, obj
    end
  end
end

Version data entries

103 entries across 75 versions & 6 rubygems

Version Path
sauce_whisk-0.0.3 vendor/psych/lib/psych/streaming.rb
sauce_whisk-0.0.2 vendor/psych/lib/psych/streaming.rb
sauce_whisk-0.0.1 vendor/psych/lib/psych/streaming.rb