Class: DateTime

Inherits:
Date show all
Defined in:
lib/ffi_yajl/json_gem.rb,
lib/ffi_yajl/ffi/encoder.rb,
ext/ffi_yajl/ext/encoder/encoder.c

Instance Method Summary collapse

Instance Method Details

#ffi_yajl(rb_yajl_gen, state) ⇒ Object



267
268
269
270
271
272
# File 'ext/ffi_yajl/ext/encoder/encoder.c', line 267

def ffi_yajl(yajl_gen, state)
  str = self.to_s
  if ( status = FFI_Yajl.yajl_gen_string(yajl_gen, str, str.bytesize) ) != 0
    FFI_Yajl::Encoder.raise_error_for_status(status)
  end
end

#to_json(*opts, &block) ⇒ Object



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

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