Saturday, 17 August 2013

If : is needed when undef a method from class

If : is needed when undef a method from class

I'm learning Ruby. You can undef a method from a class:
class Person
undef :talk
end
But when I tried this code, I found that if I didn't use ":" sign, it also
worked:
class Person
undef talk
end
So I wonder if this ":" is neccessary and what this ":" stands for?

No comments:

Post a Comment