Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/cinch/rubyext/string.rb

Instance Method Summary collapse

Instance Method Details

#irc_downcase(mapping) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/cinch/rubyext/string.rb', line 2

def irc_downcase(mapping)
  case mapping
  when :rfc1459
    self.tr("A-Z[]\\\\^", "a-z{}|~")
  when :"strict-rfc1459"
    self.tr("A-Z[]\\\\", "a-z{}|")
  else
    # when :ascii or unknown/nil
    self.tr("A-Z", "a-z")
  end
end

#irc_upcase(mapping) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/cinch/rubyext/string.rb', line 14

def irc_upcase(mapping)
  case mapping
  when :ascii
    self.tr("a-z", "A-Z")
  when :rfc1459
    self.tr("a-z{}|~", "A-Z[]\\\\^")
  when :strict-rfc1459
    self.tr("a-z{}|", "A-Z[]\\\\")
  end
end