[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
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-....