Module: Term::ANSIColour

Included in:
Kernel
Defined in:
lib/rcl/ext/ansicolour.rb

Constant Summary collapse

@@colour =

XXX - why don’t attr_reader and attr_writer work?

['reset']

Class Method Summary collapse

Class Method Details

.attributesObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/rcl/ext/ansicolour.rb', line 79

def ANSIColour.attributes
  { 'default'    => '0',
    'clear'      => '0',
    'reset'      => '0',
    'bold'       => '1',
    'dark'       => '2',
    'underline'  => '4',
    'blink'      => '5',
    'reverse'    => '7',
    'concealed'  => '8',

    'black'      => '30',   'on_black'   => '40',
    'red'        => '31',   'on_red'     => '41',
    'green'      => '32',   'on_green'   => '42',
    'yellow'     => '33',   'on_yellow'  => '43',
    'blue'       => '34',   'on_blue'    => '44',
    'magenta'    => '35',   'on_magenta' => '45',
    'cyan'       => '36',   'on_cyan'    => '46',
    'white'      => '37',   'on_white'   => '47'
  }
end

.colourObject



65
66
67
# File 'lib/rcl/ext/ansicolour.rb', line 65

def ANSIColour.colour
  @@colour
end

.colour=(*string) ⇒ Object



69
70
71
72
73
74
75
76
77
# File 'lib/rcl/ext/ansicolour.rb', line 69

def ANSIColour.colour=(*string)
  # why does this seem to work?
  @@colour = string[0]

  # why won't his work?
  # @@colour = string

  return @@colour
end