Sha256: b091fedd371e70586e27167e34773dac521f197c7990e8f0fa0992bf4e0f8ba1
Contents?: true
Size: 511 Bytes
Versions: 13
Compression:
Stored size: 511 Bytes
Contents
module Formulario class Field class Date < DefaultTimeField private def self.base_class ::Date end def self.allowed_keys %i[ year month day ] end def self.parse_hash(hash) return invalid_keys_exceptional_value(hash) if has_invalid_keys?(hash) now = ::Date.today new ::Date.new( hash[:year] || now.year, hash[:month] || now.month, hash[:day] || now.day, ) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems