我最近转向 asdf 来管理运行时(特别是 Node、Ruby 和 Python)。但是,我通过 Homebrew 安装了很多软件包,这些软件包依赖于 Homebrew 本身安装的这些运行时之一的版本。我想删除这些并仅通过 asdf 管理运行时。
如何让 Homebrew 使用 asdf 管理的运行时?
对于此示例哈希
hash = {:key=>"value"}
Run Code Online (Sandbox Code Playgroud)
所有这些都是true:
hash.key?(:key)
hash.has_key?(:key) #deprecated in favor of .key?
hash.include?(:key)
hash.member?(:key)
Run Code Online (Sandbox Code Playgroud)
Ruby Docs为这三个提供相同的解释
"Returns `true` if the given key is present in ..."
Run Code Online (Sandbox Code Playgroud)
我的问题是:在实际的Ruby使用中,每个都有特定的用例吗?或者,这只是有多种方法来解决同样的问题?
非常感谢指向特定文档或参考的链接!