class Psych::Visitors::JSONTree

def accept target

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