+/**************************************************************************************************
+ * Ruby BSON API for EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
+ *
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
#include "rbbson.h"
#include <ruby.h>
-#include <math.h>
#include <string.h>
-#include <tcejdb/ejdb.h>
#define BSON_CONTEXT_RUBY_CLASS "EJDB_BSON_CONTEXT"
#define BSON_RUBY_CLASS "EJDB_BSON"
* call-seq:
* results.count -> Number
*
- * Returns total number of query result objects
+ * Returns total number of query result objects.
*/
VALUE EJDB_results_count(VALUE self) {
RBEJDB_RESULTS* rbresults;
return rbresults->log ? rb_str_new2(TCXSTRPTR(rbresults->log)) : Qnil;
}
-void EJDB_results_close(VALUE self) {
+/*
+ * call-seq:
+ * results.close -> nil
+ *
+ * Closes query results and immediately frees memory taken for results.
+ * Calling this method invalidates results container and any further access attempts will cause +RuntimeError+.
+ */
+VALUE EJDB_results_close(VALUE self) {
RBEJDB_RESULTS* rbresults;
Data_Get_Struct(self, RBEJDB_RESULTS, rbresults);
close_ejdb_results_internal(rbresults);
+ return Qnil;
}
/*
rb_define_private_method(ejdbBinaryClass, "initialize", RUBY_METHOD_FUNC(EJDB_binary_init), 1);
rb_define_method(ejdbBinaryClass, "each", RUBY_METHOD_FUNC(EJDB_binary_each), 0);
- /* :nodoc: */
+ /*
+ * Internal EJDB class. :nodoc:
+ */
ejdbQueryClass = rb_define_class("EJDBQuery", rb_cObject);
}
\ No newline at end of file