Ruby has its own point of view on how private methods should work. The 'private' keyword (actually it is an method in ruby) is only recommendation for other programmers and there are plenty of methods to access it. The first way is to call method through 'send' method or using 'instance_eval()'. The other situation is when private methods are accessed during calling them from other instance of the same class (it is shown here https://gist.github.com/646672).
Комментариев нет:
Отправить комментарий