diff options
author | Florian Frank <flori@ping.de> | 2010-09-22 22:21:02 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2010-09-23 01:16:01 +0200 |
commit | e3fe104e7d5ec184aac36128aed2d217cb655dfc (patch) | |
tree | 3a63dc0152effdb990defcd5c935e38209649a8f /lib/json | |
parent | 2c0f8d2c9b15a33b8d10ffcb1959aef54d320b57 (diff) | |
download | json-e3fe104e7d5ec184aac36128aed2d217cb655dfc.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 |