lib/psych/visitors/json_tree.rb in psych-1.3.4 vs lib/psych/visitors/json_tree.rb in psych-2.0.0
- old
+ new
@@ -3,11 +3,14 @@
module Psych
module Visitors
class JSONTree < YAMLTree
include Psych::JSON::RubyEvents
- def initialize options = {}, emitter = Psych::JSON::TreeBuilder.new
- super
+ def self.create options = {}
+ emitter = Psych::JSON::TreeBuilder.new
+ class_loader = ClassLoader.new
+ ss = ScalarScanner.new class_loader
+ new(emitter, ss, options)
end
def accept target
if target.respond_to?(:encode_with)
dump_coder target