Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/flr/string_extensions.rb
Overview
Instance Method Summary collapse
- #bg_black ⇒ Object
- #bg_blue ⇒ Object
- #bg_cyan ⇒ Object
- #bg_green ⇒ Object
- #bg_magenta ⇒ Object
- #bg_red ⇒ Object
- #bg_white ⇒ Object
- #bg_yellow ⇒ Object
- #black ⇒ Object
- #blink ⇒ Object
- #blue ⇒ Object
- #bold ⇒ Object
- #bright ⇒ Object
- #cyan ⇒ Object
- #error_style ⇒ Object
- #green ⇒ Object
- #italic ⇒ Object
- #magenta ⇒ Object
- #red ⇒ Object
- #reverse_color ⇒ Object
- #tips_style ⇒ Object
- #underline ⇒ Object
- #warning_style ⇒ Object
- #white ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#bg_black ⇒ Object
35 36 37 |
# File 'lib/flr/string_extensions.rb', line 35 def bg_black "\e[40m#{self}\e[m" end |
#bg_blue ⇒ Object
51 52 53 |
# File 'lib/flr/string_extensions.rb', line 51 def bg_blue "\e[44m#{self}\e[m" end |
#bg_cyan ⇒ Object
59 60 61 |
# File 'lib/flr/string_extensions.rb', line 59 def bg_cyan "\e[46m#{self}\e[m" end |
#bg_green ⇒ Object
43 44 45 |
# File 'lib/flr/string_extensions.rb', line 43 def bg_green "\e[42m#{self}\e[m" end |
#bg_magenta ⇒ Object
55 56 57 |
# File 'lib/flr/string_extensions.rb', line 55 def bg_magenta "\e[45m#{self}\e[m" end |
#bg_red ⇒ Object
39 40 41 |
# File 'lib/flr/string_extensions.rb', line 39 def bg_red "\e[41m#{self}\e[m" end |
#bg_white ⇒ Object
63 64 65 |
# File 'lib/flr/string_extensions.rb', line 63 def bg_white "\e[47m#{self}\e[m" end |
#bg_yellow ⇒ Object
47 48 49 |
# File 'lib/flr/string_extensions.rb', line 47 def bg_yellow "\e[43m#{self}\e[m" end |
#black ⇒ Object
3 4 5 |
# File 'lib/flr/string_extensions.rb', line 3 def black "\e[30m#{self}\e[m" end |
#blink ⇒ Object
83 84 85 |
# File 'lib/flr/string_extensions.rb', line 83 def blink "\e[5m#{self}\e[m" end |
#blue ⇒ Object
19 20 21 |
# File 'lib/flr/string_extensions.rb', line 19 def blue "\e[34m#{self}\e[m" end |
#bold ⇒ Object
67 68 69 |
# File 'lib/flr/string_extensions.rb', line 67 def bold "\e[1m#{self}\e[m" end |
#bright ⇒ Object
71 72 73 |
# File 'lib/flr/string_extensions.rb', line 71 def bright "\e[2m#{self}\e[m" end |
#cyan ⇒ Object
27 28 29 |
# File 'lib/flr/string_extensions.rb', line 27 def cyan "\e[36m#{self}\e[m" end |
#error_style ⇒ Object
91 92 93 |
# File 'lib/flr/string_extensions.rb', line 91 def error_style self.red end |
#green ⇒ Object
11 12 13 |
# File 'lib/flr/string_extensions.rb', line 11 def green "\e[32m#{self}\e[m" end |
#italic ⇒ Object
75 76 77 |
# File 'lib/flr/string_extensions.rb', line 75 def italic "\e[3m#{self}\e[m" end |
#magenta ⇒ Object
23 24 25 |
# File 'lib/flr/string_extensions.rb', line 23 def magenta "\e[35m#{self}\e[m" end |
#red ⇒ Object
7 8 9 |
# File 'lib/flr/string_extensions.rb', line 7 def red "\e[31m#{self}\e[m" end |
#reverse_color ⇒ Object
87 88 89 |
# File 'lib/flr/string_extensions.rb', line 87 def reverse_color "\e[7m#{self}\e[m" end |
#tips_style ⇒ Object
99 100 101 |
# File 'lib/flr/string_extensions.rb', line 99 def tips_style self.green end |
#underline ⇒ Object
79 80 81 |
# File 'lib/flr/string_extensions.rb', line 79 def underline "\e[4m#{self}\e[m" end |
#warning_style ⇒ Object
95 96 97 |
# File 'lib/flr/string_extensions.rb', line 95 def warning_style self.yellow end |
#white ⇒ Object
31 32 33 |
# File 'lib/flr/string_extensions.rb', line 31 def white "\e[37m#{self}\e[m" end |
#yellow ⇒ Object
15 16 17 |
# File 'lib/flr/string_extensions.rb', line 15 def yellow "\e[33m#{self}\e[m" end |