diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-11-24 15:45:53 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-11-24 15:45:53 -0800 |
commit | 937e0b46b7845f05473c8c29d8cf0f601305958c (patch) | |
tree | e36fec09c474e9cd77d7aabfb64449cd81fb134c /ext/ffi_yajl | |
parent | 9d466797cbeb13a098dbaccf366eec495c842830 (diff) | |
download | ffi-yajl-937e0b46b7845f05473c8c29d8cf0f601305958c.tar.gz |
allow arbitrary Objects as keys
i fixed Hashes/Arrays/true/false/nil, but forgot Object.
Diffstat (limited to 'ext/ffi_yajl')
-rw-r--r-- | ext/ffi_yajl/ext/encoder/encoder.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/ffi_yajl/ext/encoder/encoder.c b/ext/ffi_yajl/ext/encoder/encoder.c index 3c22f8d..b43d02b 100644 --- a/ext/ffi_yajl/ext/encoder/encoder.c +++ b/ext/ffi_yajl/ext/encoder/encoder.c @@ -345,7 +345,7 @@ static VALUE rb_cObject_ffi_yajl(VALUE self, VALUE rb_yajl_gen, VALUE state) { ID sym_to_json = rb_intern("to_json"); VALUE str; - if ( rb_respond_to(self, sym_to_json) ) { + if ( rb_hash_aref(state, rb_str_new2("processing_key")) != Qtrue && rb_respond_to(self, sym_to_json) ) { VALUE json_opts = rb_hash_aref(state, rb_str_new2("json_opts")); struct yajl_gen_t *yajl_gen; Data_Get_Struct(rb_yajl_gen, struct yajl_gen_t, yajl_gen); |