Created
August 21, 2015 01:06
-
-
Save anonymous/ca39d53313634a42546f to your computer and use it in GitHub Desktop.
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
YAML | |
success: | |
- active | |
- enabled | |
warning | |
- rejected | |
- blocked | |
# Of course this array can be very big with many other status | |
# This generates the hash { 'success' => ['active', 'enabled'], 'warning' => ['rejected', 'blocked'] } | |
# What I want to achieve is actually : | |
{ 'active' => 'success', 'enabled' => 'success', 'rejected' => 'warning', 'blocked' => 'warning' } | |
# Is there any way to achieve that, using only YAML syntax and not repeating the values like so: | |
YAML | |
enabled: 'success' | |
active: 'success' | |
rejected: 'warning' | |
blocked: 'warning' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment