diff options
Diffstat (limited to 'ext/psych/lib/psych/streaming.rb')
-rw-r--r-- | ext/psych/lib/psych/streaming.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ext/psych/lib/psych/streaming.rb b/ext/psych/lib/psych/streaming.rb index c6fa109d5a..9d94eb549f 100644 --- a/ext/psych/lib/psych/streaming.rb +++ b/ext/psych/lib/psych/streaming.rb @@ -1,10 +1,15 @@ 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 ### |