Class: Gissuel::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/gissuel/log.rb

Instance Method Summary collapse

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

#blueObject



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

#greenObject



16
17
18
# File 'lib/gissuel/log.rb', line 16

def green
  puts colourize(32)
end

#greyObject



24
25
26
# File 'lib/gissuel/log.rb', line 24

def grey
  puts colourize(37)
end

#redObject



12
13
14
# File 'lib/gissuel/log.rb', line 12

def red
  puts colourize(31)
end

#yellowObject



20
21
22
# File 'lib/gissuel/log.rb', line 20

def yellow
  puts colourize(33)
end