Class: Mail::GrowlMailer

Inherits:
Object
  • Object
show all
Defined in:
lib/growl_mailer.rb

Overview

The GrowlMailer is a bare bones mailer that does nothing but use Growl Notify to alert to the fact a messages delivery attempt has happend

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ GrowlMailer

Returns a new instance of GrowlMailer.



9
10
11
12
13
14
15
16
# File 'lib/growl_mailer.rb', line 9

def initialize(values)
  puts values.inspect
  self.settings = {
    :icon    => 'Mail',
    :message => lambda { |mail| mail.subject },
    :title   => lambda { |mail| mail.destinations.join(", ") }
  }.merge!(values)
end

Instance Attribute Details

#settingsObject

Returns the value of attribute settings.



7
8
9
# File 'lib/growl_mailer.rb', line 7

def settings
  @settings
end

Instance Method Details

#deliver!(mail) ⇒ Object



18
19
20
21
# File 'lib/growl_mailer.rb', line 18

def deliver!(mail)
  options = options(mail)
  Growl.notify options.delete(:message), options
end