summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ffi_yajl/ffi/encoder.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb
index add35f6..af1f1a6 100644
--- a/lib/ffi_yajl/ffi/encoder.rb
+++ b/lib/ffi_yajl/ffi/encoder.rb
@@ -236,7 +236,7 @@ end
# I feel dirty
class Object
def ffi_yajl(yajl_gen, state)
- if self.respond_to?(:to_json)
+ if !state[:processing_key] && self.respond_to?(:to_json)
json = self.to_json(state[:json_opts])
# #yajl_gen_number outputs a string without quotes around it
status = FFI_Yajl.yajl_gen_number(yajl_gen, json, json.bytesize)