如果我有以下的 Ruby 哈希表:
environments = {
'testing' => '11.22.33.44',
'production' => '55.66.77.88'
}
我如何访问上述哈希表的部分内容?下面是我想要实现的一个示例。
current_environment = 'testing'
"rsync -ar root@#{environments[#{testing}]}:/htdocs/"