Class: ArchitectureJS::Notification
- Inherits:
-
Object
- Object
- ArchitectureJS::Notification
- Defined in:
- lib/architecture-js/notification.rb
Constant Summary collapse
- @@indicators =
{ none: "", log: "\e[32m>>>\e[0m ", event: "\e[33m<<<\e[0m ", added: "\e[32m+++\e[0m ", error: "\e[0;31m!!!\e[0m ", prompt: ">>> " }
Class Method Summary collapse
- .added(message) ⇒ Object
- .error(message) ⇒ Object
- .event(message) ⇒ Object
- .log(message) ⇒ Object
- .notice(message) ⇒ Object
- .notify(type, message) ⇒ Object
- .prompt ⇒ Object
Class Method Details
.added(message) ⇒ Object
46 47 48 |
# File 'lib/architecture-js/notification.rb', line 46 def self.added() self.notify :added, end |
.error(message) ⇒ Object
50 51 52 |
# File 'lib/architecture-js/notification.rb', line 50 def self.error() self.notify :error, end |
.event(message) ⇒ Object
42 43 44 |
# File 'lib/architecture-js/notification.rb', line 42 def self.event() self.notify :event, end |
.log(message) ⇒ Object
38 39 40 |
# File 'lib/architecture-js/notification.rb', line 38 def self.log() self.notify :log, end |
.notice(message) ⇒ Object
34 35 36 |
# File 'lib/architecture-js/notification.rb', line 34 def self.notice() self.notify :none, end |
.notify(type, message) ⇒ Object
29 30 31 32 |
# File 'lib/architecture-js/notification.rb', line 29 def self.notify(type, ) raise "There is no #{type} indicator" unless @@indicators[type] "#{@@indicators[type]}#{message}" end |
.prompt ⇒ Object
54 55 56 |
# File 'lib/architecture-js/notification.rb', line 54 def self.prompt self.notify :prompt, '' end |