Class: Mail::Maildir
- Inherits:
-
Object
- Object
- Mail::Maildir
- Defined in:
- lib/newsfetcher/extensions/mail.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(values) ⇒ Maildir
constructor
A new instance of Maildir.
Constructor Details
#initialize(values) ⇒ Maildir
9 10 11 |
# File 'lib/newsfetcher/extensions/mail.rb', line 9 def initialize(values) self.settings = values end |
Instance Attribute Details
#settings ⇒ Object
Returns the value of attribute settings.
7 8 9 |
# File 'lib/newsfetcher/extensions/mail.rb', line 7 def settings @settings end |
Instance Method Details
#deliver!(mail) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/newsfetcher/extensions/mail.rb', line 13 def deliver!(mail) dir = settings[:dir] or raise Error, "'dir' not found in settings" maildir = ::Maildir.new(dir) maildir.serializer = ::Maildir::Serializer::Mail.new maildir.add(mail) end |