Module: Lucian::BoardCaster

Defined in:
lib/lucian/board_caster.rb

Class Method Summary collapse

Class Method Details



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/lucian/board_caster.rb', line 3

def self.print(message, color=nil)
  color_code = case color
  when "red"
    31
  when "green"
    32
  when "yellow"
    33
  when "blue"
    34
  when "pink"
    35
  when "cyan"
    36
  when "gray"
    37
  else
    0
  end
  puts "\e[#{color_code}m#{message}\e[0m"
end