diff options
author | Florian Frank <flori@ping.de> | 2010-09-22 22:21:02 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2010-09-27 23:37:40 +0200 |
commit | 1db86436e8d8e52bfda539318610f92d095f799d (patch) | |
tree | f24b6cc4ec53563395f25a385d91897f445a814e /lib/json | |
parent | 2c0f8d2c9b15a33b8d10ffcb1959aef54d320b57 (diff) | |
download | json-1db86436e8d8e52bfda539318610f92d095f799d.tar.gz |
started to build jruby extension with Rakefile
Diffstat (limited to 'lib/json')
-rw-r--r-- | lib/json/pure/generator.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/json/pure/generator.rb b/lib/json/pure/generator.rb index 335c6ae..94cb239 100644 --- a/lib/json/pure/generator.rb +++ b/lib/json/pure/generator.rb @@ -106,11 +106,13 @@ module JSON # an unconfigured instance. If _opts_ is a State object, it is just # returned. def self.from_state(opts) - case opts - when self + case + when self === opts opts - when Hash - new(opts) + when opts.respond_to?(:to_hash) + new(opts.to_hash) + when opts.respond_to?(:to_h) + new(opts.to_h) else SAFE_STATE_PROTOTYPE.dup end |