Class: Mail::Maildir

Inherits:
Object
  • Object
show all
Defined in:
lib/newsfetcher/extensions/mail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#settingsObject

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