From 31df485a023364383353dabb97f9f0609ceddde6 Mon Sep 17 00:00:00 2001 From: tyler-ball Date: Tue, 7 Oct 2014 10:54:54 -0700 Subject: Making necessary C changes to only call to_json if it is present --- lib/ffi_yajl/ffi/encoder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ffi_yajl/ffi/encoder.rb') diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb index a493158..3724e49 100644 --- a/lib/ffi_yajl/ffi/encoder.rb +++ b/lib/ffi_yajl/ffi/encoder.rb @@ -204,7 +204,7 @@ class Object if self.respond_to?(:to_json) json = self.to_json(state[:json_opts]) else - json = self.to_s + json = "\"#{to_s}\"" end if ( status = FFI_Yajl.yajl_gen_number(yajl_gen, json, json.bytesize) ) != 0 FFI_Yajl::Encoder.raise_error_for_status(status) -- cgit v1.2.1