Sha256: f6bc645b87332fa6fbda9ce405961af674797b694552f4a5eafe726b523fb974
Contents?: true
Size: 278 Bytes
Versions: 9
Compression:
Stored size: 278 Bytes
Contents
module SafeYAML class Transform class ToDate MATCHER = /\A\d{4}\-\d{2}\-\d{2}\Z/.freeze def transform?(value) return false unless MATCHER.match(value) date = Date.parse(value) rescue nil return !!date, date end end end end
Version data entries
9 entries across 9 versions & 1 rubygems