Permalink
Browse files

Added comments to main method

  • Loading branch information...
1 parent 6edcbbc commit 46fd6215ec65cb2fea8f6f8cd4d551d82b1f75cd @hemanth committed Nov 6, 2010
Showing with 7 additions and 3 deletions.
  1. +7 −3 rgbot.rb
View
@@ -154,10 +154,14 @@ def hi(msg)
self.deliver(@msg,"Hey "+@msg.from.node+" :)")
end
- def main
- while (true) do
- @jabber.received_messages do |@msg|
+ def main
+ # The main method meant to loop and recive msgs from the chat clinet
+ while (true) do
+ # An infinte loop to keep receving msgs
+ @jabber.received_messages do |@msg|
+ # For each msg recevied do log it
File.open('log', 'w') {|log| log.write(@msg.from.node+" : "+@msg.body)}
+ # Call the invoke method
self.invoke(@msg)
end
end

0 comments on commit 46fd621

Please sign in to comment.