Module: Maildir::Keywords::MessageExtension
- Defined in:
- lib/maildir/keywords.rb
Instance Method Summary collapse
- #keywords ⇒ Object
-
#keywords=(list) ⇒ Object
sets given keywords on the message.
-
#set_keywords(list) ⇒ Object
sets @keywords to the given list.
Instance Method Details
#keywords ⇒ Object
91 92 93 94 |
# File 'lib/maildir/keywords.rb', line 91 def keywords return @keywords if @keywords @maildir.keywords(unique_name) end |
#keywords=(list) ⇒ Object
sets given keywords on the message.
97 98 99 100 101 |
# File 'lib/maildir/keywords.rb', line 97 def keywords=(list) tmp_fname = File.join(@maildir.path, 'tmp', unique_name) File.open(tmp_fname, 'w') { |f| f.write(list.join("\n")) } FileUtils.mv(tmp_fname, File.join(@maildir.keyword_dir, unique_name)) end |
#set_keywords(list) ⇒ Object
sets @keywords to the given list
104 105 106 |
# File 'lib/maildir/keywords.rb', line 104 def set_keywords(list) @keywords = list end |