### Home Classes Methods

### In Files

- lib/rbot/irc.rb

### Parent

Object

### Methods

- ::get
- ::new
- #==
- #inspect
- #lower
- #must_be
- #to_irc_casemap
- #to_s
- #upper

### Class/Module Index

Quicksearch

- Irc
- Irc::AsciiCasemap
- Irc::BanlistMessage
- Irc::BasicUserMessage
- Irc::Bot
- Irc::Bot::Auth
- Irc::Bot::Auth::BotOwnerClass
- Irc::Bot::Auth::BotUser
- Irc::Bot::Auth::Command
- Irc::Bot::Auth::DefaultBotUserClass
- Irc::Bot::Auth::InvalidPassword
- Irc::Bot::Auth::ManagerClass
- Irc::Bot::Auth::PermissionSet
- Irc::Bot::Config
- Irc::Bot::Config::ArrayValue
- Irc::Bot::Config::BooleanValue
- Irc::Bot::Config::EnumValue
- Irc::Bot::Config::FloatValue
- Irc::Bot::Config::IntegerValue
- Irc::Bot::Config::ManagerClass
- Irc::Bot::Config::StringValue
- Irc::Bot::Config::Value
- Irc::Bot::Config::Wizard
- Irc::Bot::DataFilter
- Irc::Bot::DataStream
- Irc::Bot::Language
- Irc::Bot::MessageMapper
- Irc::Bot::MessageMapper::Failure
- Irc::Bot::MessageMapper::FriendlyFailure
- Irc::Bot::MessageMapper::NoActionFailure
- Irc::Bot::MessageMapper::NoMatchFailure
- Irc::Bot::MessageMapper::NotPrivateFailure
- Irc::Bot::MessageMapper::NotPublicFailure
- Irc::Bot::MessageMapper::PartialMatchFailure
- Irc::Bot::MessageParameter
- Irc::Bot::MessageTemplate
- Irc::Bot::Plugins
- Irc::Bot::Plugins::BotModule
- Irc::Bot::Plugins::CoreBotModule
- Irc::Bot::Plugins::Plugin
- Irc::Bot::Plugins::PluginManagerClass
- Irc::Bot::Plugins::RecurseTooDeep
- Irc::Bot::Plugins::RemoteBotModule
- Irc::Bot::Plugins::RemoteCoreBotModule
- Irc::Bot::Plugins::RemotePlugin
- Irc::Bot::Registry
- Irc::Bot::Registry::Accessor
- Irc::Bot::RemoteDispatcher
- Irc::Bot::RemoteMessage
- Irc::Bot::RemoteObject
- Irc::Bot::Wordlist
- Irc::BotConfig
- Irc::Casemap
- Irc::Channel
- Irc::Channel::Mode
- Irc::Channel::ModeHash
- Irc::Channel::ModeTypeA
- Irc::Channel::ModeTypeB
- Irc::Channel::ModeTypeC
- Irc::Channel::ModeTypeD
- Irc::Channel::Topic
- Irc::Channel::UserMode
- Irc::ChannelList
- Irc::Client
- Irc::DBHash
- Irc::DBTree
- Irc::InviteMessage
- Irc::JoinMessage
- Irc::KickMessage
- Irc::MessageQueue
- Irc::ModeChangeMessage
- Irc::MotdMessage
- Irc::NamesMessage
- Irc::Netmask
- Irc::NetmaskDb
- Irc::NetmaskDb::Tree
- Irc::NetmaskList
- Irc::NickMessage
- Irc::NoSuchTargetMessage
- Irc::NoticeMessage
- Irc::PartMessage
- Irc::PrivMessage
- Irc::QueueRing
- Irc::QuitMessage
- Irc::RfcCasemap
- Irc::Server
- Irc::ServerOrCasemap
- Irc::Socket
- Irc::Socket::IdentityFilter
- Irc::StrictRfcCasemap
- Irc::TopicMessage
- Irc::UnknownMessage
- Irc::User
- Irc::UserList
- Irc::UserMessage
- Irc::Utils
- Irc::Utils::HttpUtil
- Irc::Utils::HttpUtil::CachedObject
- Irc::Utils::ParseTime
- Irc::WelcomeMessage
- Irc::WhoisMessage
- BDB
- BDB::CIBtree
- MonitorMixin
- MonitorMixin::ConditionVariable
- Net
- Net::HTTPResponse
- Regexp
- Regexp::Irc
- Singleton
- Singleton::SingletonClassMethods
- Timer
- Timer::Action
- TokyoCabinet
- TokyoCabinet::CIBDB
- UnicodePlugin
- UnicodePlugin::UnicodeFilter
- Array
- ArrayOf
- AuthModule
- BasicsModule
- ConditionVariable
- ConfigModule
- DottedIndex
- Enumerable
- Exception
- FiltersModule
- GetText
- GetTextVersionError
- HttpUtilPlugin
- IrcLogModule
- Module
- Numeric
- Object
- Range
- RemoteModule
- ServerError
- String
- Symbol
- UserDataModule
- WordlistModule
- YAML

No matching classes.

# Irc::Casemap

Due to its Scandinavian origins, IRC has strange case mappings, which consider the characters `{}|^` as the uppercase equivalents of # `[]\~`.

This is however not the same on all IRC servers: some use standard ASCII casemapping, other do not consider `^` as the uppercase of `~`

### Public Class Methods

get(name) click to toggle source

Returns the Casemap with the given name

    # File lib/rbot/irc.rb, line 86
    def Casemap.get(name)
      @@casemaps[name.to_sym][:casemap]
    end

new(name, upper, lower) click to toggle source

Create a new casemap with name name, uppercase characters upper and lowercase characters lower

    # File lib/rbot/irc.rb, line 74
    def initialize(name, upper, lower)
      @key = name.to_sym
      raise "Casemap #{name.inspect} already exists!" if @@casemaps.has_key?(@key)
      @@casemaps[@key] = {
        :upper => upper,
        :lower => lower,
        :casemap => self
      }
    end

### Public Instance Methods

==(arg) click to toggle source

Two Casemaps are equal if they have the same upper and lower ranges

    # File lib/rbot/irc.rb, line 122
    def ==(arg)
      other = arg.to_irc_casemap
      return self.upper == other.upper && self.lower == other.lower
    end

inspect() click to toggle source

A Casemap is represented by its lower/upper mappings

    # File lib/rbot/irc.rb, line 110
    def inspect
      self.__to_s__[0..-2] + " #{upper.inspect} ~(#{self})~ #{lower.inspect}>"
    end

lower() click to toggle source

Retrieve the 'lowercase characters' of this Casemap

    # File lib/rbot/irc.rb, line 98
    def lower
      @@casemaps[@key][:lower]
    end

must_be(arg) click to toggle source

Give a warning if arg and self are not the same Casemap

    # File lib/rbot/irc.rb, line 129
    def must_be(arg)
      other = arg.to_irc_casemap
      if self == other
        return true
      else
        warn "Casemap mismatch (#{self.inspect} != #{other.inspect})"
        return false
      end
    end

to_irc_casemap() click to toggle source

Return a Casemap based on the receiver

    # File lib/rbot/irc.rb, line 104
    def to_irc_casemap
      self
    end

to_s() click to toggle source

As a String we return our name

    # File lib/rbot/irc.rb, line 116
    def to_s
      @key.to_s
    end

upper() click to toggle source

Retrieve the 'uppercase characters' of this Casemap

    # File lib/rbot/irc.rb, line 92
    def upper
      @@casemaps[@key][:upper]
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.