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