Class: String

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

Overview

add a few methods for manipulating text

Instance Method Summary collapse

Instance Method Details

#indent(double_space_count = 1) ⇒ Object



29
30
31
32
# File 'lib/string.rb', line 29

def indent(double_space_count = 1)
  double_space_count.times { insert(0, '  ') }
  self
end

#to_greenObject



21
22
23
# File 'lib/string.rb', line 21

def to_green
  "\033[32m#{self}\033[0m"
end

#to_redObject



25
26
27
# File 'lib/string.rb', line 25

def to_red
  "\033[31m#{self}\033[0m"
end