Module: Nutrun::String

Defined in:
lib/nutrun-string.rb,
lib/nutrun-string/version.rb

Constant Summary collapse

VERSION =
"0.1.3"

Instance Method Summary collapse

Instance Method Details

#bg_blackObject



51
52
53
# File 'lib/nutrun-string.rb', line 51

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

#bg_blueObject



67
68
69
# File 'lib/nutrun-string.rb', line 67

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

#bg_cyanObject



75
76
77
# File 'lib/nutrun-string.rb', line 75

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

#bg_defaultObject



83
84
85
# File 'lib/nutrun-string.rb', line 83

def bg_default
  "\e[49m#{self}\e[0m"
end

#bg_greenObject



59
60
61
# File 'lib/nutrun-string.rb', line 59

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

#bg_magentaObject



71
72
73
# File 'lib/nutrun-string.rb', line 71

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

#bg_redObject



55
56
57
# File 'lib/nutrun-string.rb', line 55

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

#bg_whiteObject



79
80
81
# File 'lib/nutrun-string.rb', line 79

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

#bg_yellowObject



63
64
65
# File 'lib/nutrun-string.rb', line 63

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

#blackObject



27
28
29
# File 'lib/nutrun-string.rb', line 27

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


95
96
97
# File 'lib/nutrun-string.rb', line 95

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

#blueObject



19
20
21
# File 'lib/nutrun-string.rb', line 19

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

#brightObject



87
88
89
# File 'lib/nutrun-string.rb', line 87

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

#clear_firstObject

only works with print, puts outputs a new line that this does not delete



108
109
110
# File 'lib/nutrun-string.rb', line 108

def clear_first
  "\r#{self}"
end

#cyanObject



39
40
41
# File 'lib/nutrun-string.rb', line 39

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

#defaultObject



47
48
49
# File 'lib/nutrun-string.rb', line 47

def default
  "\e[39m#{self}\e[0m"
end

#greenObject



31
32
33
# File 'lib/nutrun-string.rb', line 31

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

#hideObject



103
104
105
# File 'lib/nutrun-string.rb', line 103

def hide
  "\e[8m#{self}\e[0m"
end

#invertObject



99
100
101
# File 'lib/nutrun-string.rb', line 99

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

#magentaObject



35
36
37
# File 'lib/nutrun-string.rb', line 35

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

#redObject



15
16
17
# File 'lib/nutrun-string.rb', line 15

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

#underlineObject



91
92
93
# File 'lib/nutrun-string.rb', line 91

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

#whiteObject



43
44
45
# File 'lib/nutrun-string.rb', line 43

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

#yellowObject



23
24
25
# File 'lib/nutrun-string.rb', line 23

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