aboutsummaryrefslogtreecommitdiff
path: root/bindings/ruby
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2023-03-22 17:43:45 -0600
committerDavid Bremner <david@tethera.net>2023-04-02 19:10:55 -0300
commit3a52290609b07b51b16b527d1c14ac9836760300 (patch)
tree7d3540a851a907cfe1bdfb0e8c598476f8c76559 /bindings/ruby
parentae1336dea5cc6a221699fff260d8b44cee677f77 (diff)
ruby: tags: return string array directly
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'bindings/ruby')
-rw-r--r--bindings/ruby/tags.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bindings/ruby/tags.c b/bindings/ruby/tags.c
index cc6ea59e..955d790f 100644
--- a/bindings/ruby/tags.c
+++ b/bindings/ruby/tags.c
@@ -23,7 +23,13 @@
VALUE
notmuch_rb_tags_get (notmuch_tags_t *tags)
{
- return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, &notmuch_rb_tags_type, tags);
+ VALUE rb_array = rb_ary_new ();
+
+ for (; notmuch_tags_valid (tags); notmuch_tags_move_to_next (tags)) {
+ const char *tag = notmuch_tags_get (tags);
+ rb_ary_push (rb_array, rb_str_new2 (tag));
+ }
+ return rb_array;
}
/*