Sha256: 17764ffdd80aac46535fa2a548380ad0ab44b201dcec04a5964c907da6f15685

Contents?: true

Size: 342 Bytes

Versions: 5

Compression:

Stored size: 342 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

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