Class: Date

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

Direct Known Subclasses

DateTime

Instance Method Summary collapse

Instance Method Details

#ffi_yajl(rb_yajl_gen, state) ⇒ Object



249
250
251
252
253
254
# File 'ext/ffi_yajl/ext/encoder/encoder.c', line 249

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



105
106
107
# File 'lib/ffi_yajl/json_gem.rb', line 105

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