Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/bro/string_hacks.rb
Instance Method Summary collapse
- #important ⇒ Object
- #problem ⇒ Object
- #sorry ⇒ Object
- #status ⇒ Object
- #success ⇒ Object
- #unindent ⇒ Object
Instance Method Details
#important ⇒ Object
22 23 24 |
# File 'lib/bro/string_hacks.rb', line 22 def important self.colored.magenta end |
#problem ⇒ Object
14 15 16 |
# File 'lib/bro/string_hacks.rb', line 14 def problem self.colored.yellow_on_red_bold end |
#sorry ⇒ Object
18 19 20 |
# File 'lib/bro/string_hacks.rb', line 18 def sorry self.colored.red.bold end |
#status ⇒ Object
6 7 8 |
# File 'lib/bro/string_hacks.rb', line 6 def status self.colored.yellow end |
#success ⇒ Object
10 11 12 |
# File 'lib/bro/string_hacks.rb', line 10 def success self.colored.green.bold end |
#unindent ⇒ Object
2 3 4 |
# File 'lib/bro/string_hacks.rb', line 2 def unindent gsub(/^#{scan(/^\s*/).min_by{|l|l.length}}/, "") end |