lib/jrjackson/jrjackson.rb in jrjackson-0.2.7 vs lib/jrjackson/jrjackson.rb in jrjackson-0.2.8
- old
+ new
@@ -1,12 +1,12 @@
unless RUBY_PLATFORM =~ /java/
puts "This library is only compatible with a java-based ruby environment like JRuby."
exit 255
end
-require_relative "jars/jrjackson-1.2.9.jar"
-# require_relative "linked/jrjackson-1.2.9.jar"
+require_relative "jars/jrjackson-1.2.11.jar"
+# require_relative "linked/jrjackson-1.2.11.jar"
require 'com/jrjackson/jr_jackson'
module JrJackson
module Json
@@ -29,13 +29,13 @@
else
JrJackson::Raw.parse_str(json_string)
end
end
- def dump(object)
+ def dump(object, options = {})
case object
- when Array, Hash, String, Java::JavaUtil::LinkedHashMap
- JrJackson::Raw.generate(object)
+ when Hash, Array, String, Java::JavaUtil::Map, Java::JavaUtil::List
+ JrJackson::Raw.generate(object, options)
when true, false
object.to_s
when nil
'null'
else