Class: WebMonitor::Mailer
- Inherits:
-
Object
- Object
- WebMonitor::Mailer
- Defined in:
- lib/web-monitor/mailer.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Mailer
constructor
A new instance of Mailer.
- #send(msg) ⇒ Object
Constructor Details
#initialize(config) ⇒ Mailer
Returns a new instance of Mailer.
3 4 5 |
# File 'lib/web-monitor/mailer.rb', line 3 def initialize(config) @email = config.alert_mail end |
Instance Method Details
#send(msg) ⇒ Object
7 8 9 10 |
# File 'lib/web-monitor/mailer.rb', line 7 def send(msg) return unless @email system %(echo '' | mail -s "#{msg}" #{@email}) end |