Class: Object

Inherits:
BasicObject
Defined in:
lib/ffi_yajl/ffi/encoder.rb,
lib/ffi_yajl/json_gem.rb

Overview

I feel dirty

Instance Method Summary collapse

Instance Method Details

#ffi_yajl(yajl_gen, state) ⇒ Object



220
221
222
223
224
225
# File 'ext/ffi_yajl/ext/encoder/encoder.c', line 220

def ffi_yajl(yajl_gen, state)
  json = self.to_json(state[:json_opts])
  if ( status = FFI_Yajl.yajl_gen_number(yajl_gen, json, json.bytesize) ) != 0
    FFI_Yajl::Encoder.raise_error_for_status(status)
  end
end

#to_json(*args, &block) ⇒ Object



116
117
118
# File 'lib/ffi_yajl/json_gem.rb', line 116

def to_json(*args, &block)
  "\"#{to_s}\""
end