Class: Conveyor::Output::Email
- Inherits:
-
Object
- Object
- Conveyor::Output::Email
- Defined in:
- lib/conveyor/output/email.rb
Class Method Summary collapse
- .error(*msg) ⇒ Object
- .mail ⇒ Object
- .reset! ⇒ Object
- .say(*msg) ⇒ Object (also: info, debug)
- .warning(*msg) ⇒ Object
- .write(msgtype, *msg) ⇒ Object
Class Method Details
.error(*msg) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/conveyor/output/email.rb', line 19 def error(*msg) @msg_queue ||= [] = msg. msg = msg.join("\n") if msg.class == Array @msg_queue << msg end |
.mail ⇒ Object
33 34 35 36 37 38 |
# File 'lib/conveyor/output/email.rb', line 33 def mail return if @msg_queue.nil? || @msg_queue.empty? puts "Sending email to #{Conveyor::Foreman.instance.notify_list}" puts @msg_queue reset! end |
.reset! ⇒ Object
11 12 13 |
# File 'lib/conveyor/output/email.rb', line 11 def reset! @msg_queue = [] end |
.say(*msg) ⇒ Object Also known as: info, debug
5 6 7 |
# File 'lib/conveyor/output/email.rb', line 5 def say(*msg) # Do nothing end |
.warning(*msg) ⇒ Object
15 16 17 |
# File 'lib/conveyor/output/email.rb', line 15 def warning(*msg) # Do nothing end |
.write(msgtype, *msg) ⇒ Object
27 28 29 30 31 |
# File 'lib/conveyor/output/email.rb', line 27 def write(msgtype, *msg) if respond_to?(msgtype) self.send(msgtype, *msg) end end |