Class: StringIrc
- Inherits:
-
Object
- Object
- StringIrc
- Defined in:
- lib/string-irc.rb
Constant Summary collapse
- COLOR_CODE =
u0003
"\x03"
- BOLD =
u0002
"\x02"
- UNDERLINE =
u001F
"\x1f"
- INVERSE =
u0016
"\x16"
- CLEAR =
u000F
"\x0f"
- COLOR_TABLE =
{ 0 => %w(white), 1 => %w(black), 2 => %w(blue navy), 3 => %w(green), 4 => %w(red), 5 => %w(brown maroon), 6 => %w(purple), 7 => %w(orange olive), 8 => %w(yellow), 9 => %w(light_green lime), 10 => %w(teal a_green blue_cyan), 11 => %w(light_cyan cyan aqua), 12 => %w(light_blue royal), 13 => %w(pink light_purple fuchsia), 14 => %w(grey), 15 => %w(light_grey silver), }
- ORIGINAL_COLOR_SCHEME =
{ "rainbow" => %w(red orange yellow green blue light_blue purple), # order is referred: http://ja.wikipedia.org/wiki/%E8%99%B9 "seven_eleven" => %w(orange green red) }
- @@color_name_table =
{}
Instance Method Summary collapse
- #bold ⇒ Object
-
#initialize(string = nil) ⇒ StringIrc
constructor
A new instance of StringIrc.
- #inverse ⇒ Object
- #stringfy ⇒ Object (also: #to_s)
- #underline ⇒ Object
Constructor Details
#initialize(string = nil) ⇒ StringIrc
Returns a new instance of StringIrc.
34 35 36 |
# File 'lib/string-irc.rb', line 34 def initialize(string = nil) @string = string end |
Instance Method Details
#bold ⇒ Object
73 74 75 |
# File 'lib/string-irc.rb', line 73 def bold add_code_l BOLD end |
#inverse ⇒ Object
81 82 83 |
# File 'lib/string-irc.rb', line 81 def inverse add_code_l INVERSE end |
#stringfy ⇒ Object Also known as: to_s
85 86 87 |
# File 'lib/string-irc.rb', line 85 def stringfy "#{@string}#{CLEAR}" end |
#underline ⇒ Object
77 78 79 |
# File 'lib/string-irc.rb', line 77 def underline add_code_l UNDERLINE end |