Module: UI
- Defined in:
- lib/arkana/helpers/ui.rb
Overview
Contains utilities related to display information to the user on the Terminal (the user’s interface).
Class Method Summary collapse
-
.crash(message) ⇒ Object
Logs the message in red color and raise an error with the given message.
-
.debug(message) ⇒ Object
Logs the message in cyan color.
-
.logger ⇒ Object
Logger used to log all the messages.
-
.success(message) ⇒ Object
Logs the message in green color.
-
.warn(message) ⇒ Object
Logs the message in yellow color.
Class Method Details
.crash(message) ⇒ Object
Logs the message in red color and raise an error with the given message.
10 11 12 13 |
# File 'lib/arkana/helpers/ui.rb', line 10 def self.crash() logger.fatal(.red) raise end |
.debug(message) ⇒ Object
Logs the message in cyan color.
16 17 18 |
# File 'lib/arkana/helpers/ui.rb', line 16 def self.debug() logger.debug(.cyan) end |
.logger ⇒ Object
Logger used to log all the messages.
31 32 33 |
# File 'lib/arkana/helpers/ui.rb', line 31 def self.logger @logger ||= Logger.new($stdout) end |
.success(message) ⇒ Object
Logs the message in green color.
21 22 23 |
# File 'lib/arkana/helpers/ui.rb', line 21 def self.success() logger.info(.green) end |
.warn(message) ⇒ Object
Logs the message in yellow color.
26 27 28 |
# File 'lib/arkana/helpers/ui.rb', line 26 def self.warn() logger.warn(.yellow) end |