Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/bro/string_hacks.rb

Instance Method Summary collapse

Instance Method Details

#importantObject



22
23
24
# File 'lib/bro/string_hacks.rb', line 22

def important
  self.colored.magenta
end

#problemObject



14
15
16
# File 'lib/bro/string_hacks.rb', line 14

def problem
  self.colored.yellow_on_red_bold
end

#sorryObject



18
19
20
# File 'lib/bro/string_hacks.rb', line 18

def sorry
  self.colored.red.bold
end

#statusObject



6
7
8
# File 'lib/bro/string_hacks.rb', line 6

def status
  self.colored.yellow
end

#successObject



10
11
12
# File 'lib/bro/string_hacks.rb', line 10

def success
  self.colored.green.bold
end

#unindentObject



2
3
4
# File 'lib/bro/string_hacks.rb', line 2

def unindent 
  gsub(/^#{scan(/^\s*/).min_by{|l|l.length}}/, "")
end