]> git.cworth.org Git - notmuch/blobdiff - bindings/ruby/tags.c
ruby: add tags helper
[notmuch] / bindings / ruby / tags.c
index db8b4cfc86f0b3eaa818ce0d7876862158826862..cc6ea59ece07ca5aacfebc8d776f28c54b593992 100644 (file)
 
 #include "defs.h"
 
+VALUE
+notmuch_rb_tags_get (notmuch_tags_t *tags)
+{
+    return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, &notmuch_rb_tags_type, tags);
+}
+
 /*
  * call-seq: TAGS.destroy! => nil
  *
 VALUE
 notmuch_rb_tags_destroy (VALUE self)
 {
-    notmuch_tags_t *tags;
-
-    Data_Get_Notmuch_Tags (self, tags);
-
-    notmuch_tags_destroy (tags);
-    DATA_PTR (self) = NULL;
+    notmuch_rb_object_destroy (self, &notmuch_rb_tags_type);
 
     return Qnil;
 }