Sha256: 2dd052500f57097b7d608b42625f257cf7ec7faf15f74c5ae2a7e1c50c62c6a4
Contents?: true
Size: 385 Bytes
Versions: 12
Compression:
Stored size: 385 Bytes
Contents
module Datev class DateField < Field def format options[:format] end def validate!(value) super if value raise ArgumentError.new("Value given for field '#{name}' is not a Date or Time") unless value.is_a?(Time) || value.is_a?(Date) end end def output(value, _context=nil) value.strftime(format) if value end end end
Version data entries
12 entries across 12 versions & 1 rubygems