function like "function_exits"

G

Girard Fred

Robert said:
No, it behaves the same, you will get a respond_to?(foo) false at the
main level.

To learn ruby, i 'm trying to developpe a batch from php to ruby. I made
classes easely in ruby, and now i'm coding my main script. In this main
script, i don't want make a main class, just a code 'procedural'
(step1, step2 ..) with some calls of my classes. In this vision, i'am
trying to do same algorythmy, so i have in php a
function_exists()...and, like a good dog, i do the same in ruby;)
I think in PHPOO for coding in Ruby, probably not the very good way, but
it helps me to translate (i made a function print_r;))
I'm not use OnRail yet, i want know ruby first.
Probably i made some mistakes, but it's just my second day on ruby...and
it seems i like it;)
 
M

MonkeeSage

No, it behaves the same, you will get a respond_to?(foo) false at the
main level.

You have to pass a second parameter to respond_to? to include private
methods. ;)

Regards,
Jordan
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top