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.
9 10 11 12 |
# File 'lib/arkana/helpers/ui.rb', line 9 def self.crash() logger.fatal(.red) raise end |
.debug(message) ⇒ Object
Logs the message in cyan color.
15 16 17 |
# File 'lib/arkana/helpers/ui.rb', line 15 def self.debug() logger.debug(.cyan) end |
.logger ⇒ Object
Logger used to log all the messages.
30 31 32 |
# File 'lib/arkana/helpers/ui.rb', line 30 def self.logger @logger ||= Logger.new($stdout) end |
.success(message) ⇒ Object
Logs the message in green color.
20 21 22 |
# File 'lib/arkana/helpers/ui.rb', line 20 def self.success() logger.info(.green) end |
.warn(message) ⇒ Object
Logs the message in yellow color.
25 26 27 |
# File 'lib/arkana/helpers/ui.rb', line 25 def self.warn() logger.warn(.yellow) end |