 (ns circle.ruby
   (:refer-clojure :exclude [eval send methods])
   (:import org.jruby.RubySymbol)
+  (:import java.io.PrintWriter)
+  (:import java.io.StringWriter)
   (:import java.lang.ref.WeakReference)
   (:use [circle.util.except :only (throw-if-not)])
   (:require fs))

  (ensure-runtime)
  (-> runtime deref (.get)))

(defmulti ->ruby
  "Convert Ruby data to Clojure data"
  class)

(defmethod ->ruby
  nil [n]
  (-> (ruby) (.getNil)))

(defmethod ->ruby
  :default [val]
  (org.jruby.RubyString/newString (ruby) (format "Uncastable values: %s" val)))

(def sample-objectid-string "4ee6911fe4b05e6a4d3605fe")

