123456789_123456789_123456789_123456789_123456789_

Class: Psych::Visitors::JSONTree

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, YAMLTree, Visitor
Instance Chain:
Inherits: Psych::Visitors::YAMLTree
Defined in: ext/psych/lib/psych/visitors/json_tree.rb

Class Method Summary

Instance Attribute Summary

YAMLTree - Inherited

Instance Method Summary

Constructor Details

This class inherits a constructor from Psych::Visitors::YAMLTree

Class Method Details

.create(options = {})

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/json_tree.rb', line 9

def self.create options = {}
  emitter = Psych::JSON::TreeBuilder.new
  class_loader = ClassLoader.new
  ss           = ScalarScanner.new class_loader
  new(emitter, ss, options)
end

Instance Method Details

#accept(target)

[ GitHub ]

  
# File 'ext/psych/lib/psych/visitors/json_tree.rb', line 16

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