Answer
Rail parser handles keys like "yes" or "no" evaluate to boolean true and false, therefore:
yes -> true
no -> false
In order to use the strings ‘yes’ and ‘no’ as keys, you need to wrap them with quotes:
"yes" : "yes"
"no" : "no"
There's a long list of reserved words with this behavior:
y|Y|yes|Yes|YES|n|N|no|No|NO
|true|True|TRUE|false|False|FALSE
|on|On|ON|off|Off|OFF
This applies to both YML and YAML files.
Comments
1 comment
This is because YAML 1.1 and earlier used a broader definition of booleans, accepting words like "yes", "no", "on", and "off" in addition to "true" and "false".
Starting with YAML 1.2, the specification became stricter and only accepts "true" and "false" as valid booleans. As a result, when you try to parse a YML file with "yes" or "no" keys using a YAML parser that complies with the YAML 1.2 specification, these keys will be converted to "true" or "false" accordingly.
You can create extremely dramatic matches in basket random. Funny sports games are both entertaining and bring humor to everyone.
Please sign in to leave a comment.