开发者

Can I reflect all the methods of a class in Ruby [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Get list of a开发者_运维技巧 class' methods

Suppose I haven't any reference on hand, and I want to see all the methods in the built-in File class, is that simply available?

---------------------------EDIT---------------------------

answered in Get list of a class' instance methods


Sure, try:

File.methods

And if you have the awesome_print gem installed then it formats the list nicely and provides extra information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜