Any ruby library to inspect what are the arguments that a certain methods take?

后端 未结 2 526
终归单人心
终归单人心 2021-01-23 05:29

is there any library that can inspect and display what are the arguments that a method takes?

2条回答
  •  攒了一身酷
    2021-01-23 05:59

    There's Method#arity that lists how many arguments a method can take.

    However, you can't determine what types of objects a method expects. That just isn't in the nature of Ruby.

提交回复
热议问题