Class: Util::Message
- Inherits:
-
Object
- Object
- Util::Message
- Defined in:
- lib/utilities/utils.rb
Overview
-
MESSAGES ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Instance Method Summary collapse
-
#error(msg) ⇒ Object
1.3.
-
#heading(msg) ⇒ Object
1.4.
-
#paragraph(msg) ⇒ Object
1.5.
-
#success(msg) ⇒ Object
1.2.
-
#warning(msg) ⇒ Object
1.1.
Instance Method Details
#error(msg) ⇒ Object
1.3. ERROR MESSAGE ——————————————————-
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/utilities/utils.rb', line 48 def error(msg) symbol = "\u274C" puts "" puts Paint["#{symbol.encode('utf-8')} : #{msg}", :red] puts "" exit 1 end |
#heading(msg) ⇒ Object
1.4. HEADING
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/utilities/utils.rb', line 64 def heading(msg) puts "" puts Paint["-----------------------------------------------------", :cyan] puts Paint["--", :cyan] puts Paint["-- #{ msg }", :cyan] puts Paint["--", :cyan] puts Paint["-----------------------------------------------------", :cyan] puts "" end |
#paragraph(msg) ⇒ Object
1.5. PARAGRAPH
80 81 82 83 84 85 86 |
# File 'lib/utilities/utils.rb', line 80 def paragraph(msg) puts "" puts Paint[msg, "999999"] puts "" end |
#success(msg) ⇒ Object
1.2. SUCCESS MESSAGE —————————————————–
34 35 36 37 38 39 40 41 42 |
# File 'lib/utilities/utils.rb', line 34 def success(msg) symbol = "\u2713" puts "" puts Paint["#{symbol.encode('utf-8')} : #{msg}", :green] puts "" end |
#warning(msg) ⇒ Object
1.1. WARNING MESSAGE —————————————————–
20 21 22 23 24 25 26 27 28 |
# File 'lib/utilities/utils.rb', line 20 def warning(msg) symbol = "\u2757" puts "" puts Paint["#{symbol.encode('utf-8')} : #{msg}", :yellow] puts "" end |