[英]How can I figure out which line of my routes.rb file has Rails 2 grammar?
[英]In Ruby on rails, how can I figure out which class mix in which module?
我是Rails的新手,我想找到某种方法来获取某些类中可用的方法?
我应该签出在线文档或使用ri工具,如果有一个图形工具来显示每个类与模块之间的关系,那将是非常棒的。
如果您只想查看可用于任何类的方法,请尝试以下操作:
CLASS_NAME.methods # list of all methods available
CLASS_NAME.instance_methods # list of all instance methods
CLASS_NAME.public_instance_methods # list of all instance methods which are public
CLASS_NAME.private_instance_methods # list of all instance methods which are private
CLASS_NAME.protected_instance_methods # list of all instance methods which are protected
使用DRX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.