Sha256: d42ecb2ddf67d33e5b08cb04d0746a78f5d93d889b4e94d9c5bfb2b395288491

Contents?: true

Size: 423 Bytes

Versions: 11

Compression:

Stored size: 423 Bytes

Contents

#include "integer_ext.h"

static VALUE cInteger;

void Init_integer_ext() {
  cInteger = rb_const_get(rb_cObject, rb_intern("Integer"));
  rb_define_method(cInteger, "to_json", (VALUE(*)(ANYARGS)) &to_json, -1);
}
  
/**
 * Returns a JSON string representation for this Integer number.
 */
static VALUE to_json(argc, argv, self)
  int argc;
  VALUE *argv;
  VALUE self;
{
  return rb_funcall(self, rb_intern("to_s"), 0);
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fjson-0.0.4 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.8 ext/extensions/integer_ext/integer_ext.c
fjson-0.1.0 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.2 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.3 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.5 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.6 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.7 ext/extensions/integer_ext/integer_ext.c
fjson-0.0.9 ext/extensions/integer_ext/integer_ext.c
fjson-0.1.1 ext/extensions/integer_ext/integer_ext.c
fjson-0.1.2 ext/extensions/integer_ext/integer_ext.c