Sha256: 2b670b963b6f81f7f66e4f37bad19c46b05dca7e1f209304025dc793c53e23ac

Contents?: true

Size: 374 Bytes

Versions: 1

Compression:

Stored size: 374 Bytes

Contents

# frozen_string_literal: true

require 'time'

module Koine
  module Attributes
    module Adapter
      class Time < Base
        private

        def coerce_not_nil(value)
          wrap_errors do
            secure do
              next value if value.is_a?(::Time)

              ::Time.parse(value)
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
koine-attributes-1.2.4 lib/koine/attributes/adapter/time.rb