VALUE
notmuch_rb_query_destroy(VALUE self);
+VALUE
+notmuch_rb_query_get_sort(VALUE self);
+
VALUE
notmuch_rb_query_set_sort(VALUE self, VALUE sortv);
+VALUE
+notmuch_rb_query_get_string(VALUE self);
+
VALUE
notmuch_rb_query_search_threads(VALUE self);
notmuch_rb_cQuery = rb_define_class_under(mod, "Query", rb_cData);
rb_undef_method(notmuch_rb_cQuery, "initialize");
rb_define_method(notmuch_rb_cQuery, "destroy", notmuch_rb_query_destroy, 0);
+ rb_define_method(notmuch_rb_cQuery, "sort", notmuch_rb_query_get_sort, 0);
rb_define_method(notmuch_rb_cQuery, "sort=", notmuch_rb_query_set_sort, 1);
+ rb_define_method(notmuch_rb_cQuery, "to_s", notmuch_rb_query_get_string, 0);
rb_define_method(notmuch_rb_cQuery, "search_threads", notmuch_rb_query_search_threads, 0);
rb_define_method(notmuch_rb_cQuery, "search_messages", notmuch_rb_query_search_messages, 0);
return Qnil;
}
+/*
+ * call-seq: QUERY.sort => fixnum
+ *
+ * Get sort type of the +QUERY+
+ */
+VALUE
+notmuch_rb_query_get_sort(VALUE self)
+{
+ notmuch_query_t *query;
+
+ Data_Get_Notmuch_Query(self, query);
+
+ return FIX2INT(notmuch_query_get_sort(query));
+}
+
/*
* call-seq: QUERY.sort=(fixnum) => nil
*
return Qnil;
}
+/*
+ * call-seq: QUERY.to_s => string
+ *
+ * Get query string of the +QUERY+
+ */
+VALUE
+notmuch_rb_query_get_string(VALUE self)
+{
+ notmuch_query_t *query;
+
+ Data_Get_Notmuch_Query(self, query);
+
+ return rb_str_new2(notmuch_query_get_query_string(query));
+}
+
/*
* call-seq: QUERY.search_threads => THREADS
*