开发者

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

开发者 https://www.devze.com 2023-03-15 03:33 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Get list of a开发者_运维技巧 class' methods
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

精彩评论

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