Class: Coyote::Notifier
- Inherits:
-
Object
- Object
- Coyote::Notifier
- Defined in:
- lib/coyote/notifier.rb
Class Method Summary collapse
- .color(message, color) ⇒ Object
- .colors ⇒ Object
- .notify(message, options) ⇒ Object
- .timestamp(message) ⇒ Object
Class Method Details
.color(message, color) ⇒ Object
25 26 27 |
# File 'lib/coyote/notifier.rb', line 25 def self.color(, color) .send(color) end |
.colors ⇒ Object
29 30 31 32 33 |
# File 'lib/coyote/notifier.rb', line 29 def self.colors {:success => :green, :warning => :yellow, :failure => :red } end |
.notify(message, options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/coyote/notifier.rb', line 5 def self.notify(, ) = String() if .include? :timestamp = end .each do |option| if colors.has_key? option = color(, colors[option]) end end puts end |
.timestamp(message) ⇒ Object
21 22 23 |
# File 'lib/coyote/notifier.rb', line 21 def self.() "#{Time.new.strftime("%I:%M:%S")} #{}" end |