Robert D. wrote:
On Dec 7, 2007 2:49 PM, MonkeeSage [email protected] wrote:
p self.private_methods.include?(“foo”) # => true
But you don’t really want that…
You want respond_to? which Just Works everywhere.
No, it behaves the same, you will get a respond_to?(foo) false at the
And really, you
probably don’t even want to be asking if a method is defined (depends
on your code), but usually there are better ways of doing things (like
All truth passes through three stages. First, it is ridiculed. Second,
it is violently opposed. Third, it is accepted as being self-evident.
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;)