Why Enumerable adds "replace" method?

  • Thread starter Iñaki Baz Castillo
  • Start date
I

Iñaki Baz Castillo

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
 
D

Daniel Berger

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

Iñaki Baz Castillo

El Lunes, 23 de Febrero de 2009, Daniel Berger escribi=F3:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top