class IRC_message

Public Class Methods

new(command, nick, channel, message, ircmsg) click to toggle source
# File lib/rirc.rb, line 15
def initialize(command, nick, channel, message, ircmsg)
        @command = command
        @nick = nick
        @channel = channel
        @message = message
        @ircmsg = ircmsg
end

Public Instance Methods

channel() click to toggle source
# File lib/rirc.rb, line 39
def channel
        return @channel
end
check_regex(type, regex) click to toggle source
# File lib/rirc.rb, line 43
def check_regex(type, regex)

        if type == "command"
                if @command.match(regex) then return true end
        elsif type == "nick"
                if @nick.match(regex) then return true end
        elsif type == "channel"
                if @channel.match(regex) then return true end
        elsif type == "message"
                if @message.match(regex) then return true end
        else
                if @message.match(regex) then return true end
        end

        return false
end
command() click to toggle source
# File lib/rirc.rb, line 35
def command
        return @command
end
ircmsg() click to toggle source
# File lib/rirc.rb, line 23
def ircmsg
        return @ircmsg
end
message() click to toggle source
# File lib/rirc.rb, line 27
def message
        return @message
end
message_regex(regex) click to toggle source
# File lib/rirc.rb, line 60
def message_regex(regex)
        if @message.match(regex) then return true end

        return false
end
nick() click to toggle source
# File lib/rirc.rb, line 31
def nick
        return @nick
end