ext/yajl_ext.c in yajl-ruby-0.5.10 vs ext/yajl_ext.c in yajl-ruby-0.5.11
- old
+ new
@@ -561,32 +561,10 @@
// JSON Gem compatibility
/*
- * Document-class: Object
- */
-/*
- * Document-method: to_json
- *
- * call-seq: to_json(encoder=Yajl::Encoder.new)
- *
- * +encoder+ is an existing Yajl::Encoder used to encode JSON
- *
- * Encodes an instance of Object to JSON
- */
-static VALUE rb_yajl_json_ext_object_to_json(int argc, VALUE * argv, VALUE self) {
- VALUE rb_encoder;
- rb_scan_args(argc, argv, "01", &rb_encoder);
- if (rb_encoder == Qnil) {
- rb_encoder = rb_yajl_encoder_new(0, NULL, cEncoder);
- }
- VALUE str = rb_funcall(self, intern_to_s, 0);
- return rb_yajl_encoder_encode(1, &str, rb_encoder);
-}
-
-/*
* Document-class: Hash
*/
/*
* Document-method: to_json
*
@@ -761,10 +739,9 @@
* call-seq: enable_json_gem_compatability
*
* Enables the JSON gem compatibility API
*/
static VALUE rb_yajl_encoder_enable_json_gem_ext(VALUE klass) {
- rb_define_method(rb_cObject, "to_json", rb_yajl_json_ext_object_to_json, -1);
rb_define_method(rb_cHash, "to_json", rb_yajl_json_ext_hash_to_json, -1);
rb_define_method(rb_cArray, "to_json", rb_yajl_json_ext_array_to_json, -1);
rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
rb_define_method(rb_cFloat, "to_json", rb_yajl_json_ext_float_to_json, -1);
rb_define_method(rb_cString, "to_json", rb_yajl_json_ext_string_to_json, -1);