我知道我們可以做這樣的事情:可以在一個here文件中放置一個條件語句嗎?
puts <<START
----Some documents
#{if true
"yesyesyesyesyesyesyesyesyesyes"
else
"nonononononononononononononono"
end}
----Some documents
START
但是,它可以這樣做:
puts <<START
----Some documents
#{if true}
yesyesyesyesyesyesyesyesyesyes
#{else}
nonononononononononononononono
#{end}
----Some documents
START
爲什麼我想這是因爲我在這裏文檔中討厭的單/雙引號,避免他們會使文件更清晰
任何人都可以提供幫助嗎?
謝謝!
謝謝,它有幫助!特別是對於大一到紅寶石來說。 – aaron