Sha256: 2d95a37e1801fdeb2477c6bb5771a5b4ec5b5e2b447a131162a9b4b04dc93dbf

Contents?: true

Size: 407 Bytes

Versions: 11

Compression:

Stored size: 407 Bytes

Contents

#include "float_ext.h"

static VALUE cFloat;

void Init_float_ext() {
  cFloat = rb_const_get(rb_cObject, rb_intern("Float"));
  rb_define_method(cFloat, "to_json", (VALUE(*)(ANYARGS)) &to_json, -1);
}

/**
 * Returns a JSON string representation for this Float 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.2 ext/extensions/float_ext/float_ext.c
fjson-0.0.3 ext/extensions/float_ext/float_ext.c
fjson-0.0.4 ext/extensions/float_ext/float_ext.c
fjson-0.0.5 ext/extensions/float_ext/float_ext.c
fjson-0.0.6 ext/extensions/float_ext/float_ext.c
fjson-0.0.7 ext/extensions/float_ext/float_ext.c
fjson-0.0.8 ext/extensions/float_ext/float_ext.c
fjson-0.0.9 ext/extensions/float_ext/float_ext.c
fjson-0.1.0 ext/extensions/float_ext/float_ext.c
fjson-0.1.1 ext/extensions/float_ext/float_ext.c
fjson-0.1.2 ext/extensions/float_ext/float_ext.c