Class: Sonic::UI
- Inherits:
-
Object
- Object
- Sonic::UI
- Defined in:
- lib/sonic/ui.rb
Constant Summary collapse
- @@mute =
false- @@noop =
false
Class Method Summary collapse
- .error(msg = '') ⇒ Object
- .mute ⇒ Object
- .mute=(v) ⇒ Object
- .noop=(v) ⇒ Object
- .say(msg = '') ⇒ Object
- .warn(msg = '') ⇒ Object
Class Method Details
.error(msg = '') ⇒ Object
21 22 23 |
# File 'lib/sonic/ui.rb', line 21 def error(msg='') say "ERROR: #{msg}".color(:red) end |
.mute ⇒ Object
5 6 7 |
# File 'lib/sonic/ui.rb', line 5 def mute @@mute end |
.mute=(v) ⇒ Object
8 9 10 |
# File 'lib/sonic/ui.rb', line 8 def mute=(v) @@mute=v end |
.noop=(v) ⇒ Object
13 14 15 |
# File 'lib/sonic/ui.rb', line 13 def noop=(v) @@noop=v end |
.say(msg = '') ⇒ Object
17 18 19 20 |
# File 'lib/sonic/ui.rb', line 17 def say(msg='') msg = "NOOP: #{msg}" if @@noop puts msg unless mute end |
.warn(msg = '') ⇒ Object
24 25 26 |
# File 'lib/sonic/ui.rb', line 24 def warn(msg='') say "WARN: #{msg}".color(:yellow) end |