[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: eval, attr_* like methods
From:       Navindra Umanee <navindra () cs ! mcgill ! ca>
Date:       2005-08-12 21:55:49
Message-ID: 20050812145544.A25119 () cs ! mcgill ! ca
[Download RAW message or body]

Patrick Gundlach <clr7.10.randomuser@spamgourmet.com> wrote:
> Yes, it helps! But there are two more questions left: since this
> lookup_meth is defined in Ojbect, it might get overridden by another
> method definition of the same name, right? Is it possible to move this
> definition somewhere 'closer' to my classes? And number two: I have

You can move it as close as to the class itself.  It's just a class
method.  Or you could put it in a super-class and inherit from that.

class Test
  def self.do_something(*args)
    puts "doing something with #{args}"
  end
end

class Test
  do_something :foobar
end

Cheers,
Navin.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic