Is it possible to use floats in YAML hashes with Ruby?

If I have a YAML file, for example

--- 2.1: my product version 

without quotes, Ruby will treat 2.1 as a Float (at least under Syck - I'm not sure about Psych).

Are there any risks when using Float as a hash key if all the other occurrences of the key are either from a YAML file or from literals from Ruby?

+1
source share

Source: https://habr.com/ru/post/1389718/


All Articles