From: Daniel Berger Date: 2008-10-30T00:31:51+09:00 Subject: Re: Named arguments gem On Oct 27, 9:58 pm, Macario Ortega wrote: > Macario Ortega wrote: > > Daniel Berger wrote: > >> On Oct 27, 6:09 pm, Macario Ortega wrote: > > >>> require 'named_arguments' > >> Yes, of course. > > >>> Please add this line at the top: > >>> Object.send( :include, NamedArguments ) > > >> This works fine. > > >>> If you get this error: > >>> uninitialized constant NamedArguments > > >>>named_argumentshas not been required > > >>> Please let me know how it goes. > > >> It doesn't work. > > >> Regards, > > >> Dan > > > I don't know why it doesn't work. Do the specs fail? > > I will check tomorrow in a fresh machine. > > Right I think I know whats wrong. > > there is another gem namednamed_arguments 0.0.5 at ruby forge > > Mine is just hosted at github > > If you want to give it a try you have to downolad it fromhttp://github.com/maca/namedarguments/tree/master/ > > and install acording to the Readme file. Aha, thanks, that explains it. Could I convince you to change the name then? I mean, you could do more than named arguments couldn't you? Also, it would eliminate the confusion. Could you also add some sort of optional pseudo-static typing that would automatically raise a TypeError if the wrong type was given? class Example def test_method(Fixnum alpha = 1, String beta = "world") [alpha, beta] end end ex = Example.new ex.test_method(:beta => "Hello", :alpha => 3) # ok ex.test_method(:alpha => "Hello", :beta => 3) # TypeError If so, consider it a feature request. :) Regards, Dan