Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: times is a method?
e
9/4/2006 4:53:00 PM
gaurav bagga wrote:
> Fixnum.ancestors.each do |x|
> p
> "------------------------------------:#{x}---------------------------------"
> x.methods.each do
> |y| p y if y =~ /^t/
> end
> end
5.methods.grep 'times'
Fixnum.instance_methods.grep 'times'
> <snip />
>
> one more thing...
>
> if i want to try something like
>
> 5 = MyNum.new how to do that .. i did something but dint work.....
Numbers are literals, you cannot assign to them. Not
sure why you would want to? If you need your own
numeric class, you need to take a few more steps.
> thanks in advance
>
> regards
> gaurav v bagga
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: times is a method?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password