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

List:       ruby-talk
Subject:    Re: Why specify module names redundantly in Modules?
From:       Neil Stevens <neil () hakubi ! us>
Date:       2005-04-15 22:29:49
Message-ID: pan.2005.04.15.22.27.40.338331 () hakubi ! us
[Download RAW message or body]

On Fri, 15 Apr 2005 13:31:59 -0700, Chris wrote:
> I have to do this:
> 
> Module Foo
>    def Foo.bar
>       "bar"
>    end
> end
> 
> What's up with that?  Seems redundant to me.  (Oh, I already said
> that!) :-)  But I thought I would ask.  Maybe there is a good reason
> for this?  Or, maybe there is a way around this?

It is redundant, but you can do this:

Module Foo
	def self.bar
		"bar"
	end
end

All that class and extend stuff some people are doing here is unnecessary,
as far as I can tell.

-- 
Neil Stevens - neil@hakubi.us

'A republic, if you can keep it.' -- Benjamin Franklin


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

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