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