Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/flr/string_extensions.rb

Overview

Instance Method Summary collapse

Instance Method Details

#bg_blackObject



35
36
37
# File 'lib/flr/string_extensions.rb', line 35

def bg_black
  "\e[40m#{self}\e[m"
end

#bg_blueObject



51
52
53
# File 'lib/flr/string_extensions.rb', line 51

def bg_blue
  "\e[44m#{self}\e[m"
end

#bg_cyanObject



59
60
61
# File 'lib/flr/string_extensions.rb', line 59

def bg_cyan
  "\e[46m#{self}\e[m"
end

#bg_greenObject



43
44
45
# File 'lib/flr/string_extensions.rb', line 43

def bg_green
  "\e[42m#{self}\e[m"
end

#bg_magentaObject



55
56
57
# File 'lib/flr/string_extensions.rb', line 55

def bg_magenta
  "\e[45m#{self}\e[m"
end

#bg_redObject



39
40
41
# File 'lib/flr/string_extensions.rb', line 39

def bg_red
  "\e[41m#{self}\e[m"
end

#bg_whiteObject



63
64
65
# File 'lib/flr/string_extensions.rb', line 63

def bg_white
  "\e[47m#{self}\e[m"
end

#bg_yellowObject



47
48
49
# File 'lib/flr/string_extensions.rb', line 47

def bg_yellow
  "\e[43m#{self}\e[m"
end

#blackObject



3
4
5
# File 'lib/flr/string_extensions.rb', line 3

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


83
84
85
# File 'lib/flr/string_extensions.rb', line 83

def blink
  "\e[5m#{self}\e[m"
end

#blueObject



19
20
21
# File 'lib/flr/string_extensions.rb', line 19

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

#boldObject



67
68
69
# File 'lib/flr/string_extensions.rb', line 67

def bold
  "\e[1m#{self}\e[m"
end

#brightObject



71
72
73
# File 'lib/flr/string_extensions.rb', line 71

def bright
  "\e[2m#{self}\e[m"
end

#cyanObject



27
28
29
# File 'lib/flr/string_extensions.rb', line 27

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

#error_styleObject



91
92
93
# File 'lib/flr/string_extensions.rb', line 91

def error_style
  self.red
end

#greenObject



11
12
13
# File 'lib/flr/string_extensions.rb', line 11

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

#italicObject



75
76
77
# File 'lib/flr/string_extensions.rb', line 75

def italic
  "\e[3m#{self}\e[m"
end

#magentaObject



23
24
25
# File 'lib/flr/string_extensions.rb', line 23

def magenta
  "\e[35m#{self}\e[m"
end

#redObject



7
8
9
# File 'lib/flr/string_extensions.rb', line 7

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

#reverse_colorObject



87
88
89
# File 'lib/flr/string_extensions.rb', line 87

def reverse_color
  "\e[7m#{self}\e[m"
end

#tips_styleObject



99
100
101
# File 'lib/flr/string_extensions.rb', line 99

def tips_style
  self.green
end

#underlineObject



79
80
81
# File 'lib/flr/string_extensions.rb', line 79

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

#warning_styleObject



95
96
97
# File 'lib/flr/string_extensions.rb', line 95

def warning_style
  self.yellow
end

#whiteObject



31
32
33
# File 'lib/flr/string_extensions.rb', line 31

def white
  "\e[37m#{self}\e[m"
end

#yellowObject



15
16
17
# File 'lib/flr/string_extensions.rb', line 15

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