Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/mycommands/views/view.rb

Overview

For more formating options: en.wikipedia.org/wiki/ANSI_escape_code#Codes

Instance Method Summary collapse

Instance Method Details

#blackObject



11
12
13
# File 'lib/mycommands/views/view.rb', line 11

def black
  "\e[30m#{self}\e[0m"
end

#blueObject



23
24
25
# File 'lib/mycommands/views/view.rb', line 23

def blue
  "\e[94m#{self}\e[0m"
end

#cyanObject



26
27
28
# File 'lib/mycommands/views/view.rb', line 26

def cyan
  "\e[96m#{self}\e[0m"
end

#greenObject



17
18
19
# File 'lib/mycommands/views/view.rb', line 17

def green
  "\e[92m#{self}\e[0m"
end

#normalObject



5
6
7
# File 'lib/mycommands/views/view.rb', line 5

def normal
  self
end

#redObject



14
15
16
# File 'lib/mycommands/views/view.rb', line 14

def red
  "\e[91m#{self}\e[0m"
end

#underlineObject



8
9
10
# File 'lib/mycommands/views/view.rb', line 8

def underline
  "\e[4m#{self}\e[0m"
end

#yellowObject



20
21
22
# File 'lib/mycommands/views/view.rb', line 20

def yellow
  "\e[93m#{self}\e[0m"
end