Sha256: e3802a2c4e0efc83164b372b779708887b49c556a8acc0ab708e6d2992cca8db

Contents?: true

Size: 421 Bytes

Versions: 11

Compression:

Stored size: 421 Bytes

Contents

#include "false_class_ext.h"

static VALUE cFalseClass;

void Init_false_class_ext() {
  cFalseClass = rb_const_get(rb_cObject, rb_intern("FalseClass"));
  rb_define_method(cFalseClass, "to_json", (VALUE(*)(ANYARGS)) &to_json, -1);
}

/**
 * Returns a JSON string for false: 'false'.
 */
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/false_class_ext/false_class_ext.c
fjson-0.0.3 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.0.4 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.0.5 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.0.6 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.0.7 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.0.8 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.0.9 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.1.0 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.1.1 ext/extensions/false_class_ext/false_class_ext.c
fjson-0.1.2 ext/extensions/false_class_ext/false_class_ext.c