Why is "rb_define_method(rb_cSymbol, ..." needed?

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

Iñaki Baz Castillo

Hi, I'm inspecting the C code of String#capitalize method and have found th=
e=20
following:

rb_define_method(rb_cSymbol, "capitalize", sym_capitalize, 0);

What is it need for? I didn't add such line to my custom C method and works=
=20
ok.

=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
 
I

Iñaki Baz Castillo

El Viernes 03 Abril 2009, I=C3=B1aki Baz Castillo escribi=C3=B3:
Hi, I'm inspecting the C code of String#capitalize method and have found
the following:

rb_define_method(rb_cSymbol, "capitalize", sym_capitalize, 0);

What is it need for? I didn't add such line to my custom C method and wor= ks
ok.

Ops, understood!

It added "capitalize" method also to Symbols :)

=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
 

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,825
Latest member
VernonQuy6

Latest Threads

Top