Module: IRC::Client::Modules::Base::Utils::Server

Defined in:
lib/failirc/client/modules/Base.rb

Constant Summary collapse

@@defaultSupportedModes =
[
    { :mode => 'o', :status => '@' },
    { :mode => 'h', :status => '%' },
    { :mode => 'v', :status => '+' }
]

Class Method Summary collapse

Class Method Details

.supportedModesObject



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/failirc/client/modules/Base.rb', line 102

def self.supportedModes
    if !Base.supported['PREFIX']
        return @@defaultSupportedModes
    else
        match = Base.supported['PREFIX'].match(/\((.*?)\)(.*)$/)

        if !match
            return @@defaultSupportedModes
        else
            modes    = match[1].split
            statuses = match[2].split
            result   = []

            1.upto(modes.length) {|f|
                result.push({
                    :mode   => modes.shift,
                    :status => statuses.shift,
                })
            }

            return result
        end
    end
end