Class: GmailNotifier
- Inherits:
-
Object
- Object
- GmailNotifier
- Defined in:
- lib/gmail_notifier.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ GmailNotifier
constructor
A new instance of GmailNotifier.
- #notify(message, options = {}) ⇒ Object
Constructor Details
#initialize(options) ⇒ GmailNotifier
Returns a new instance of GmailNotifier.
4 5 6 7 |
# File 'lib/gmail_notifier.rb', line 4 def initialize() @name, @password = .delete(:name), .delete(:password) @options = end |
Instance Method Details
#notify(message, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/gmail_notifier.rb', line 9 def notify(, = {}) [:body] = [:subject] = if !.has_key? :subject @options.each {|k,v| [k] = v if !.has_key? k } GMailer.connect(@name, @password) do |g| g.send() end end |