Sha256: 8013117c9c9c580a654df55a5212b5f37b79f4ac1148e6a2bbb7c0dd071ab81e

Contents?: true

Size: 376 Bytes

Versions: 5

Compression:

Stored size: 376 Bytes

Contents

module Koine
  module Attributes
    module Adapter
      class Date < Base
        private

        def coerce_not_nil(date)
          wrap_errors do
            secure do
              next date if date.is_a?(::Date)
              next date.to_date if date.is_a?(::Time)
              ::Date.parse(date)
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
koine-attributes-1.2.3 lib/koine/attributes/adapter/date.rb
koine-attributes-1.2.2 lib/koine/attributes/adapter/date.rb
koine-attributes-1.2.1 lib/koine/attributes/adapter/date.rb
koine-attributes-1.2.0 lib/koine/attributes/adapter/date.rb
koine-attributes-1.1.0 lib/koine/attributes/adapter/date.rb