Module: RBText::Formatting
- Included in:
- F
- Defined in:
- lib/rbtext/formatting.rb
Class Method Summary collapse
- .blinking ⇒ Object
- .bold ⇒ Object
- .faint ⇒ Object
- .italic ⇒ Object
- .reset(f_opt = nil) ⇒ Object
- .strikethrough ⇒ Object
- .underline ⇒ Object
Class Method Details
.blinking ⇒ Object
29 30 31 |
# File 'lib/rbtext/formatting.rb', line 29 def blinking "\033[5m" end |
.bold ⇒ Object
13 14 15 |
# File 'lib/rbtext/formatting.rb', line 13 def bold "\033[1m" end |
.faint ⇒ Object
17 18 19 |
# File 'lib/rbtext/formatting.rb', line 17 def faint "\033[2m" end |
.italic ⇒ Object
21 22 23 |
# File 'lib/rbtext/formatting.rb', line 21 def italic "\033[3m" end |
.reset(f_opt = nil) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/rbtext/formatting.rb', line 3 def reset(f_opt = nil) if f_opt "\033[#{ f_opt =~ /^\033\[(1|2)m$/ ? "\033[22m" : "\033[2#{f_opt.gsub(/[^0-9]/, "")}m" }" else "\033[0m" end end |
.strikethrough ⇒ Object
33 34 35 |
# File 'lib/rbtext/formatting.rb', line 33 def strikethrough "\033[9m" end |
.underline ⇒ Object
25 26 27 |
# File 'lib/rbtext/formatting.rb', line 25 def underline "\033[4m" end |