Class: IRC_message
- Inherits:
-
Object
- Object
- IRC_message
- Defined in:
- lib/rirc.rb
Instance Method Summary collapse
- #channel ⇒ Object
- #check_regex(type, regex) ⇒ Object
- #command ⇒ Object
-
#initialize(command, nick, channel, message, ircmsg) ⇒ IRC_message
constructor
A new instance of IRC_message.
- #ircmsg ⇒ Object
- #message ⇒ Object
- #message_regex(regex) ⇒ Object
- #nick ⇒ Object
Constructor Details
#initialize(command, nick, channel, message, ircmsg) ⇒ IRC_message
Returns a new instance of IRC_message.
15 16 17 18 19 20 21 |
# File 'lib/rirc.rb', line 15 def initialize(command, nick, channel, , ircmsg) @command = command @nick = nick @channel = channel @message = @ircmsg = ircmsg end |
Instance Method Details
#channel ⇒ Object
39 40 41 |
# File 'lib/rirc.rb', line 39 def channel return @channel end |
#check_regex(type, regex) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# 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 ⇒ Object
35 36 37 |
# File 'lib/rirc.rb', line 35 def command return @command end |
#ircmsg ⇒ Object
23 24 25 |
# File 'lib/rirc.rb', line 23 def ircmsg return @ircmsg end |
#message ⇒ Object
27 28 29 |
# File 'lib/rirc.rb', line 27 def return @message end |
#message_regex(regex) ⇒ Object
60 61 62 63 64 |
# File 'lib/rirc.rb', line 60 def (regex) if @message.match(regex) then return true end return false end |
#nick ⇒ Object
31 32 33 |
# File 'lib/rirc.rb', line 31 def nick return @nick end |