Extensions to Ruby's String class.
Like `String#downcase`, but respecting different IRC casemaps.
@param [:rfc1459, :"strict-rfc1459", :ascii] mapping @return [String]
# File lib/cinch/rubyext/string.rb, line 7 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
Like `String#upcase`, but respecting different IRC casemaps.
@param [:rfc1459, :"strict-rfc1459", :ascii] mapping @return [String]
# File lib/cinch/rubyext/string.rb, line 23 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
Generated with the Darkfish Rdoc Generator 2.