lib/psych/streaming.rb in psych-1.3.4 vs lib/psych/streaming.rb in psych-2.0.0
- old
+ new
@@ -1,11 +1,16 @@
module Psych
module Streaming
- ###
- # Create a new streaming emitter. Emitter will print to +io+. See
- # Psych::Stream for an example.
- def initialize io
- super({}, self.class.const_get(:Emitter).new(io))
+ 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