[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Why Enumerable adds "replace" method?

Iñaki Baz Castillo

2/23/2009 7:31:00 PM

Hi, when including Enumerable module in a class, its instances get=20
the "replace" method in which I'm not interested. Why this method is added?=
=20
It doesn't appear in Enumerable.

Thanks.


=2D-=20
I=C3=B1aki Baz Castillo

2 Answers

Daniel Berger

2/23/2009 7:39:00 PM

0



On Feb 23, 12:30=A0pm, I=F1aki Baz Castillo <i...@aliax.net> wrote:
> Hi, when including Enumerable module in a class, its instances get
> the "replace" method in which I'm not interested. Why this method is adde=
d?


It isn't.

Ruby 1.8.6 p114

class Foo
include Enumerable
end

Foo.instance_methods.include?('replace') =3D> false

Regards,

Dan

Iñaki Baz Castillo

2/23/2009 7:48:00 PM

0

El Lunes, 23 de Febrero de 2009, Daniel Berger escribi=F3:
> On Feb 23, 12:30=A0pm, I=F1aki Baz Castillo <i...@aliax.net> wrote:
> > Hi, when including Enumerable module in a class, its instances get
> > the "replace" method in which I'm not interested. Why this method is
> > added?
>
> It isn't.
>
> Ruby 1.8.6 p114
>
> class Foo
> include Enumerable
> end
>
> Foo.instance_methods.include?('replace') =3D> false

Sorry, my fault. Thanks a lot.


=2D-=20
I=F1aki Baz Castillo