ruby中用ancestor取得类的祖先链

Ruby | 2013-01-27 03:06:56 | 阅读 2232 次 | 评论(0)
[4] pry(main)> Array.ancestors
=> [Array, Enumerable, Object, PP::ObjectMixin, Kernel, BasicObject]
[5] pry(main)> String.ancestors
=> [String, Comparable, Object, PP::ObjectMixin, Kernel, BasicObject]

文章评论,共0条
游客请输入验证码
浏览1921458次
文章归档
最新评论
  • Miss_Zou:不都是复制粘贴的吗
  • Miss_Zou:目测是大佬
  • 神犇dengyuhy:语文很好