From: Mikkel Kroman Date: 2010-02-08T23:59:25+09:00 Subject: Re: String constant reference to another class instance variable Thanks for both your answer, but what I want to achieve is something like the following: (This is a early stage irc lib I'm using) #!/usr/bin/env ruby # encoding: utf-8 require File.dirname(__FILE__) + '/lib/irc' IRC::Connect hostname: 'irc.phora.net' do def on_message(nick, channel, message, *args) # This is what I want it to be like: # nick.say("Hello there, #{nick}!") # or atleast something like that. # but for now, I'm stuck with this: privmsg(nick, "Hello there, #{nick}!") # is it maybe possible to make some # kind of 'alias'? end end nick is a string and I think it's too exaggerated to make nick have it's own kind of class, just to have this method. Oh, and another thing.. How would I be able to create User instances which also should have access to the IRC::Client's socket? Currently I'm using User.new("nick", @socket) which is, well.. yeah. Sincerely, Mikkel Kroman. -- Posted via http://www.ruby-forum.com/.