【问题标题】:How to list all the methods in a Module using Pry navigation?如何使用 Pry 导航列出模块中的所有方法?
【发布时间】:2012-11-20 19:44:18
【问题描述】:

Pry 提供的功能,使用 'cd' 更改内容并使用 'ls' 显示其中的所有方法和变量。

我的问题是如何在 Module 中使用它,比如在 Math 模块中显示所有方法

【问题讨论】:

  • 这一直对我有用:cd Math ls Math.methods: acos acosh asin asinh atan atan2 ...这对你不起作用吗?

标签: ruby pry


【解决方案1】:
[4] pry(main)> ls Math -m
Math.methods: acos  acosh  asin  asinh  atan  atan2  atanh  cbrt  cos  cosh  erf  erfc  exp  frexp  gamma  hypot  ldexp  lgamma  log  log10  log2  sin  sinh  sqrt  tan  tanh
[5] pry(main)> 

【讨论】:

    猜你喜欢
    • 2021-06-13
    • 1970-01-01
    • 1970-01-01
    • 2015-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-10
    • 2020-07-15
    相关资源
    最近更新 更多