Friday 16 March 2007

Visibility in ruby

Note: The RichText blog has moved to www.ricroberts.com

Back in January, I made this post about ruby instance variables in derived classes.

I recently came across this post by Jamis Buck (one of the core Rails guys) with some more info about method visibility in ruby. Basically, he explains that private and protected methods are visible by all derived classes.

This seems a bit free and easy, coming from a C-sharp view point. In rails, this means, for example, that the controllers can't call the models' private methods and vice-versa. But all controllers can access all of the application controller's methods, so it's hard to hide it's inner workings from the other controllers if you want to.



Digg Technorati del.icio.us Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy

Please also visit the Swirrl blog

No comments: