7
如果我有以下红宝石哈希:访问一个Ruby散列具有可变的关键
environments = {
'testing' => '11.22.33.44',
'production' => '55.66.77.88'
}
我将如何访问上述哈希的部分?下面是我想要实现的一个示例。
current_environment = 'testing'
"rsync -ar [email protected]#{environments[#{testing}]}:/htdocs/"
优秀的:)感谢你的回答。 – 2013-04-29 22:52:01
非常欢迎! – 2013-04-29 22:57:08