Last active
December 10, 2015 23:49
-
-
Save danlynn/4512649 to your computer and use it in GitHub Desktop.
The following code provides an attractive and easy way to populate a hash with multi-line text values. These multi-line text literals are defined using ruby's here-doc syntax. In this case, the values are snippets of javascript code that were simply pasted in.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash = { | |
:key1 => <<-END_VAL, | |
console.log('cow'); | |
alert('moof!'); | |
END_VAL | |
:key2 => <<-END_VAL | |
console.log('cow 2'); | |
alert('moof! 2'); | |
END_VAL | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment