74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'ext/ffi_yajl/ext/encoder/encoder.c', line 74
def ffi_yajl(yajl_gen, state)
if ( status = FFI_Yajl.yajl_gen_map_open(yajl_gen) ) != 0
FFI_Yajl::Encoder.raise_error_for_status(status)
end
self.each do |key, value|
state[:processing_key] = true
key.ffi_yajl(yajl_gen, state)
state[:processing_key] = false
value.ffi_yajl(yajl_gen, state)
end
if ( status = FFI_Yajl.yajl_gen_map_close(yajl_gen) ) != 0
FFI_Yajl::Encoder.raise_error_for_status(status)
end
end
|