Sha256: a5205f0538a05d151992151e4b48269bf67f3438674b4b33f5113712cd9edff3
Contents?: true
Size: 700 Bytes
Versions: 13
Compression:
Stored size: 700 Bytes
Contents
module Formulario class Field class Time < DefaultTimeField private def self.base_class ::Time end def self.allowed_keys %i[ year month day hour minute second timezone ] end def self.parse_hash(hash) return invalid_keys_exceptional_value(hash) if has_invalid_keys?(hash) now = ::Time.now new ::Time.new( hash[:year] || now.year, hash[:month] || now.month, hash[:day] || now.day, hash[:hour] || now.hour, hash[:minute] || now.min, hash[:second] || now.sec, hash[:timezone] || now.zone, ) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems