Class: DamageControl::Publisher::Email

Inherits:
Base
  • Object
show all
Defined in:
lib/damagecontrol/publisher/email.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

classes, register

Constructor Details

#initializeEmail

Returns a new instance of Email.



20
21
22
23
24
# File 'lib/damagecontrol/publisher/email.rb', line 20

def initialize
  @delivery_method = "sendmail"
  @to = ""
  @from = "\"DamageControl\" <[email protected]>"
end

Instance Attribute Details

#delivery_methodObject

Returns the value of attribute delivery_method.



12
13
14
# File 'lib/damagecontrol/publisher/email.rb', line 12

def delivery_method
  @delivery_method
end

#enabledObject

Returns the value of attribute enabled.



9
10
11
# File 'lib/damagecontrol/publisher/email.rb', line 9

def enabled
  @enabled
end

#fromObject

Returns the value of attribute from.



18
19
20
# File 'lib/damagecontrol/publisher/email.rb', line 18

def from
  @from
end

#toObject

Returns the value of attribute to.



15
16
17
# File 'lib/damagecontrol/publisher/email.rb', line 15

def to
  @to
end

Instance Method Details

#nameObject



26
27
28
# File 'lib/damagecontrol/publisher/email.rb', line 26

def name
  "Email"
end

#publish(build) ⇒ Object



30
31
32
33
34
# File 'lib/damagecontrol/publisher/email.rb', line 30

def publish(build)
  BuildMailer.template_root = File.expand_path(File.dirname(__FILE__) + "/../../../app/views")
  BuildMailer.delivery_method = @delivery_method      
  BuildMailer.deliver_email(build, self)
end