]> git.cworth.org Git - notmuch/blobdiff - bindings/ruby/tags.c
ruby: add tags helper
[notmuch] / bindings / ruby / tags.c
index e8226ad7433f71c1a73e37ef3cf1a0d417228d5b..cc6ea59ece07ca5aacfebc8d776f28c54b593992 100644 (file)
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see http://www.gnu.org/licenses/ .
+ * along with this program.  If not, see https://www.gnu.org/licenses/ .
  *
  * Author: Ali Polatel <alip@exherbo.org>
  */
 
 #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;
 }