Sha256: ded043b7b514e3449787ad81bd6d39abd0d0115b28c85a3b8a284a48838d5526
Contents?: true
Size: 406 Bytes
Versions: 15
Compression:
Stored size: 406 Bytes
Contents
module SafeYAML class Transform class ToBoolean PREDEFINED_VALUES = { "yes" => true, "on" => true, "true" => true, "no" => false, "off" => false, "false" => false }.freeze def transform?(value) key = value.downcase return PREDEFINED_VALUES.include?(key), PREDEFINED_VALUES[key] end end end end
Version data entries
15 entries across 15 versions & 1 rubygems