Sha256: 95ec31106958eb8fca631dfe00452d461d3eb523eaf62f71da2cfb6befd1743e

Contents?: true

Size: 436 Bytes

Versions: 11

Compression:

Stored size: 436 Bytes

Contents

require 'psych/json/ruby_events'

module Psych
  module Visitors
    class JSONTree < YAMLTree
      include Psych::JSON::RubyEvents

      def initialize options = {}, emitter = Psych::JSON::TreeBuilder.new
        super
      end

      def accept target
        if target.respond_to?(:encode_with)
          dump_coder target
        else
          send(@dispatch_cache[target.class], target)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
psych-1.3.4 lib/psych/visitors/json_tree.rb
psych-1.3.3 lib/psych/visitors/json_tree.rb
psych-1.3.2 lib/psych/visitors/json_tree.rb
psych-1.3.1 lib/psych/visitors/json_tree.rb
psych-1.3.0 lib/psych/visitors/json_tree.rb
psych-1.2.2 lib/psych/visitors/json_tree.rb
psych-1.2.2.rc1 lib/psych/visitors/json_tree.rb
psych-1.2.1 lib/psych/visitors/json_tree.rb
psych-1.2.0 lib/psych/visitors/json_tree.rb
psych-1.1.1 lib/psych/visitors/json_tree.rb
psych-1.1.0 lib/psych/visitors/json_tree.rb