diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-10-07 10:54:54 -0700 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-10-07 10:54:54 -0700 |
commit | 31df485a023364383353dabb97f9f0609ceddde6 (patch) | |
tree | d2b7bb7e620640c02c2ac27a7b634c2b3c8d30af /lib/ffi_yajl/ffi | |
parent | 3af1ec06bd861bf0eb01863cbe02dffadbf45503 (diff) | |
download | ffi-yajl-31df485a023364383353dabb97f9f0609ceddde6.tar.gz |
Making necessary C changes to only call to_json if it is present
Diffstat (limited to 'lib/ffi_yajl/ffi')
-rw-r--r-- | lib/ffi_yajl/ffi/encoder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |