Class: String

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

Overview

add a simple method for making marquees

Instance Method Summary collapse

Instance Method Details

#indent(double_space_count = 1) ⇒ Object



31
32
33
34
# File 'lib/core/ext/string.rb', line 31

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

#marqueeObject



21
22
23
24
25
# File 'lib/core/ext/string.rb', line 21

def marquee
  puts "\n#{self}"
  length.times { printf '-' }
  puts "\n"
end

#to_redObject



27
28
29
# File 'lib/core/ext/string.rb', line 27

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