Class: TrueClass

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

Instance Method Summary collapse

Instance Method Details

#ffi_yajl(rb_yajl_gen, state) ⇒ Object



128
129
130
131
132
# File 'ext/ffi_yajl/ext/encoder/encoder.c', line 128

def ffi_yajl(yajl_gen, state)
  if ( status = FFI_Yajl.yajl_gen_bool(yajl_gen, 1) ) != 0
    FFI_Yajl::Encoder.raise_error_for_status(status)
  end
end

#to_json(*opts, &block) ⇒ Object



87
88
89
# File 'lib/ffi_yajl/json_gem.rb', line 87

def to_json(*opts, &block)
  FFI_Yajl::Encoder.encode(self)
end