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
psych-2.0.10 lib/psych/streaming.rb
psych-2.0.9 lib/psych/streaming.rb
psych-2.0.8 lib/psych/streaming.rb
psych-2.0.7 lib/psych/streaming.rb
psych-2.0.6 lib/psych/streaming.rb
psych-shopifork-2.0.5 lib/psych/streaming.rb
psych-2.0.5 lib/psych/streaming.rb
psych-2.0.4 lib/psych/streaming.rb
psych-shopifork-2.0.3 lib/psych/streaming.rb
psych-2.0.3 lib/psych/streaming.rb
psych-2.0.2 lib/psych/streaming.rb
psych-shopifork-2.0.0 lib/psych/streaming.rb
psych-2.0.1 lib/psych/streaming.rb
sauce_whisk-0.0.10 vendor/psych/lib/psych/streaming.rb
sauce_whisk-0.0.9 vendor/psych/lib/psych/streaming.rb
psych-2.0.0 lib/psych/streaming.rb
sauce_whisk-0.0.8 vendor/psych/lib/psych/streaming.rb
sauce_whisk-0.0.7 vendor/psych/lib/psych/streaming.rb
sauce_whisk-0.0.5 vendor/psych/lib/psych/streaming.rb
sauce_whisk-0.0.4 vendor/psych/lib/psych/streaming.rb