Module: Teamlab::MailTags
- Included in:
- Defined in:
- lib/teamlab/modules/mail/mail_tags.rb
Overview
Methods for working with mail tags
Instance Method Summary collapse
- #create_tag(name, options = {}) ⇒ Object
- #delete_tag(id) ⇒ Object
- #get_tag_list ⇒ Object
- #remove_tag_from_messages(id, *message_ids) ⇒ Object
- #set_tag_to_messages(id, *message_ids) ⇒ Object
- #update_tag(id, name, options = {}) ⇒ Object
Instance Method Details
#create_tag(name, options = {}) ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/mail/mail_tags.rb', line 10 def create_tag(name, = {}) @request.post(%w[tags], { name: name }.merge()) end |
#delete_tag(id) ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/mail/mail_tags.rb', line 26 def delete_tag(id) @request.delete(['tags', id.to_s]) end |
#get_tag_list ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/mail/mail_tags.rb', line 6 def get_tag_list @request.get(%w[tags]) end |
#remove_tag_from_messages(id, *message_ids) ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/mail/mail_tags.rb', line 22 def (id, *) @request.put(['tags', id.to_s, 'remove'], messages: .flatten) end |
#set_tag_to_messages(id, *message_ids) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/mail/mail_tags.rb', line 18 def (id, *) @request.put(['tags', id.to_s, 'set'], messages: .flatten) end |
#update_tag(id, name, options = {}) ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/mail/mail_tags.rb', line 14 def update_tag(id, name, = {}) @request.put(['tags', id.to_s], { name: name }.merge()) end |