Class: Integrity::Notifier::Email
- Inherits:
-
Notifier::Base
- Object
- Notifier::Base
- Integrity::Notifier::Email
- Defined in:
- lib/integrity/notifier/email.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Class Method Summary collapse
Instance Method Summary collapse
- #deliver! ⇒ Object
- #email ⇒ Object
-
#initialize(commit, config = {}) ⇒ Email
constructor
A new instance of Email.
- #subject ⇒ Object
Constructor Details
#initialize(commit, config = {}) ⇒ Email
Returns a new instance of Email.
13 14 15 16 17 18 |
# File 'lib/integrity/notifier/email.rb', line 13 def initialize(commit, config={}) @to = config.delete("to") @from = config.delete("from") super(commit, config) configure_mailer end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
7 8 9 |
# File 'lib/integrity/notifier/email.rb', line 7 def from @from end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
7 8 9 |
# File 'lib/integrity/notifier/email.rb', line 7 def to @to end |
Class Method Details
.to_haml ⇒ Object
9 10 11 |
# File 'lib/integrity/notifier/email.rb', line 9 def self.to_haml File.read(File.dirname(__FILE__) + "/config.haml") end |
Instance Method Details
#deliver! ⇒ Object
20 21 22 |
# File 'lib/integrity/notifier/email.rb', line 20 def deliver! email.deliver! end |
#email ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/integrity/notifier/email.rb', line 24 def email @email ||= Sinatra::Mailer::Email.new( :to => to, :from => from, :text => body, :subject => subject ) end |
#subject ⇒ Object
33 34 35 |
# File 'lib/integrity/notifier/email.rb', line 33 def subject "[Integrity] #{commit.project.name}: #{}" end |