class String
Public Class Methods
random(options = {})
click to toggle source
# File lib/nifty/utils/extensions/string.rb, line 5 def self.random(options = {}) Nifty::Utils::RandomString.generate(options) end
Public Instance Methods
ansi(code)
click to toggle source
# File lib/nifty/utils/extensions/string.rb, line 9 def ansi(code) "\e[#{code.to_s}m#{self}\e[0m" end
blue()
click to toggle source
# File lib/nifty/utils/extensions/string.rb, line 25 def blue self.ansi(34) end
green()
click to toggle source
# File lib/nifty/utils/extensions/string.rb, line 17 def green self.ansi(32) end
red()
click to toggle source
# File lib/nifty/utils/extensions/string.rb, line 13 def red self.ansi(31) end
yellow()
click to toggle source
# File lib/nifty/utils/extensions/string.rb, line 21 def yellow self.ansi(33) end