module RiceBubble class Attributes class Datetime < Base def call(value, path: '') super(coerce(value), path:) end def coerce(value) if !value.respond_to?(:to_datetime) || value.is_a?(::Date) value else value.to_datetime end end def valid_types [::Time, ::DateTime] end end end end