Class: Gissuel::Log
- Inherits:
-
Object
- Object
- Gissuel::Log
- Defined in:
- lib/gissuel/log.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #colourize(colour_code) ⇒ Object
- #green ⇒ Object
- #grey ⇒ Object
-
#initialize(text) ⇒ Log
constructor
A new instance of Log.
- #red ⇒ Object
- #yellow ⇒ Object
Constructor Details
#initialize(text) ⇒ Log
Returns a new instance of Log.
4 5 6 |
# File 'lib/gissuel/log.rb', line 4 def initialize(text) @text = text end |
Instance Method Details
#blue ⇒ Object
28 29 30 |
# File 'lib/gissuel/log.rb', line 28 def blue puts colourize(34) end |
#colourize(colour_code) ⇒ Object
8 9 10 |
# File 'lib/gissuel/log.rb', line 8 def colourize(colour_code) "\e[#{colour_code}m#{@text}\e[0m" end |
#green ⇒ Object
16 17 18 |
# File 'lib/gissuel/log.rb', line 16 def green puts colourize(32) end |
#grey ⇒ Object
24 25 26 |
# File 'lib/gissuel/log.rb', line 24 def grey puts colourize(37) end |
#red ⇒ Object
12 13 14 |
# File 'lib/gissuel/log.rb', line 12 def red puts colourize(31) end |
#yellow ⇒ Object
20 21 22 |
# File 'lib/gissuel/log.rb', line 20 def yellow puts colourize(33) end |