Hi --

On Thu, 23 Aug 2007, Finn Koch wrote:

> David A. Black wrote:
>> Hi --
>>
>> On Thu, 23 Aug 2007, Finn Koch wrote:
>>
>>>>
>>> http://pastie.caboo.se/90341
>> In this:
>>
>> class IRCCallback
>>    def self.check_next( input )
>>      ro.conn.send("PRIVMSG testuser :hey", 0)
>>      puts "irc callback working"
>>    end
>> end
>>
>> I don't see where ro is being defined.
>>
>>
>> David
>
> Oh, sorry, that should read 'mybot.conn.send("PRIVMSG testuser :hey",
> 0)'

OK... (well, not OK :-) but I now know what you meant) but I'm now not
seeing what purpose the variable 'input' is serving.

> That's what I was trying last night.

mybot is a local variable defined in a completely different scope,
different both because method definitions have their own local scope,
and because it's in a different file, either of which would mean it
was out of scope in your method definition.

You need to pass objects around, and make requests of those objects
(i.e., send them messages). Local variables are really just scratchpad
variables for a limited scope.


David

-- 
* Books:
   RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242)
   RUBY FOR RAILS (http://www.manning.com/black)
* Ruby/Rails training
     & consulting:  Ruby Power and Light, LLC (http://www.rubypal.com)