Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/bookmarks.rb
Overview
thx danhassin
Instance Method Summary collapse
- #blu ⇒ Object
- #colorize(color, mod) ⇒ Object
- #grn ⇒ Object
- #red ⇒ Object
- #reset ⇒ Object
- #window(width) ⇒ Object
- #yel ⇒ Object
Instance Method Details
#blu ⇒ Object
22 |
# File 'lib/bookmarks.rb', line 22 def blu() colorize(34,0) end |
#colorize(color, mod) ⇒ Object
17 18 19 |
# File 'lib/bookmarks.rb', line 17 def colorize(color, mod) "\033[#{mod};#{color};49m#{self}\033[0;0m" end |
#grn ⇒ Object
24 |
# File 'lib/bookmarks.rb', line 24 def grn() colorize(32,0) end |
#red ⇒ Object
25 |
# File 'lib/bookmarks.rb', line 25 def red() colorize(31,0) end |
#reset ⇒ Object
21 |
# File 'lib/bookmarks.rb', line 21 def reset() colorize(0,0) end |
#window(width) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/bookmarks.rb', line 9 def window(width) if self.length >= width self[0..width-1] else self.ljust(width) end end |
#yel ⇒ Object
23 |
# File 'lib/bookmarks.rb', line 23 def yel() colorize(33,0) end |