From d90e2a31870d4d80bb43b7e3d146293fdf05a2e3 Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Fri, 2 Apr 2010 11:18:13 -0700 Subject: [PATCH] remove fetch_row(s) methods, mixin Enumerable --- ext/mysql2_ext.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/mysql2_ext.c b/ext/mysql2_ext.c index bfc95e1..3511aff 100644 --- a/ext/mysql2_ext.c +++ b/ext/mysql2_ext.c @@ -260,10 +260,13 @@ void Init_mysql2_ext() { rb_define_method(cMysql2Client, "escape", rb_mysql_client_escape, 1); cMysql2Result = rb_define_class_under(mMysql2, "Result", rb_cObject); - rb_define_method(cMysql2Result, "fetch_row", rb_mysql_result_fetch_row, -1); - rb_define_method(cMysql2Result, "fetch_rows", rb_mysql_result_fetch_rows, -1); + // rb_define_method(cMysql2Result, "fetch_row", rb_mysql_result_fetch_row, -1); + // rb_define_method(cMysql2Result, "fetch_rows", rb_mysql_result_fetch_rows, -1); rb_define_method(cMysql2Result, "each", rb_mysql_result_fetch_rows, -1); + VALUE mEnumerable = rb_const_get(rb_cObject, rb_intern("Enumerable")); + rb_include_module(cMysql2Result, mEnumerable); + // intern_new = rb_intern("new"); sym_symbolize_keys = ID2SYM(rb_intern("symbolize_keys"));