Class: String::Colorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/padrino-support/core_ext/string/colorize.rb

Overview

Used to colorize strings for the shell

Class Method Summary collapse

Class Method Details

.colorsObject

Returns colors integer mapping



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/padrino-support/core_ext/string/colorize.rb', line 29

def self.colors
  @_colors ||= {
    :default => 9,
    :black   => 30,
    :red     => 31,
    :green   => 32,
    :yellow  => 33,
    :blue    => 34,
    :magenta => 35,
    :cyan    => 36,
    :white   => 37
  }
end

.modesObject

Returns modes integer mapping



44
45
46
47
48
49
# File 'lib/padrino-support/core_ext/string/colorize.rb', line 44

def self.modes
  @_modes ||= {
    :default => 0,
    :bold    => 1
  }
end