Module: Psych::Streaming::ClassMethods

Included in:
JSON::Stream, Psych::Stream
Defined in:
lib/psych/streaming.rb

Instance Method Summary collapse

Instance Method Details

#new(io) ⇒ Object

Create a new streaming emitter. Emitter will print to io. See Psych::Stream for an example.



8
9
10
11
12
13
# File 'lib/psych/streaming.rb', line 8

def new io
  emitter      = const_get(:Emitter).new(io)
  class_loader = ClassLoader.new
  ss           = ScalarScanner.new class_loader
  super(emitter, ss, {})
end