Class: TrueClass

Inherits:
Object show all
Defined in:
lib/ffi_yajl/ffi/encoder.rb

Instance Method Summary collapse

Instance Method Details

#ffi_yajl(rb_yajl_gen, state) ⇒ Object



270
271
272
273
274
275
276
277
278
279
280
281
# File 'ext/ffi_yajl/ext/encoder/encoder.c', line 270

def ffi_yajl(yajl_gen, state)
  str = to_s
  if state[:processing_key]
    if ( status = FFI_Yajl.yajl_gen_string(yajl_gen, str, str.bytesize) ) != 0
      FFI_Yajl::Encoder.raise_error_for_status(status, str)
    end
  else
    if ( status = FFI_Yajl.yajl_gen_bool(yajl_gen, 1) ) != 0
      FFI_Yajl::Encoder.raise_error_for_status(status, str)
    end
  end
end