X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fruby%2Fquery.c;h=6a70f192bbd06de0a2206fd7af64afee4b444642;hp=c5b8a4cc324f278ed6ff0ec17007c8eb90c01538;hb=a08aa32b44b28f50f00cbd69e1a39023158f1847;hpb=44ea57a0d10ddab514abea319c4d25ec4e36b51e diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c index c5b8a4cc..6a70f192 100644 --- a/bindings/ruby/query.c +++ b/bindings/ruby/query.c @@ -21,7 +21,7 @@ #include "defs.h" /* - * call-seq: QUERY.destroy => nil + * call-seq: QUERY.destroy! => nil * * Destroys the query, freeing all resources allocated for it. */ @@ -38,6 +38,21 @@ notmuch_rb_query_destroy(VALUE self) 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 * @@ -58,6 +73,21 @@ notmuch_rb_query_set_sort(VALUE self, VALUE sortv) 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 *