Sha256: e35dc8849e6b2547dd76b08cad48358de2a36cd5937f33b42f7f5508e8410e65

Contents?: true

Size: 270 Bytes

Versions: 5

Compression:

Stored size: 270 Bytes

Contents

require 'time'

module Koine
  module Attributes
    module Adapter
      class Time < Base
        def coerce(value)
          secure do
            next value if value.is_a?(::Time)
            ::Time.parse(value)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
koine-attributes-0.2.3 lib/koine/attributes/adapter/time.rb
koine-attributes-0.2.2 lib/koine/attributes/adapter/time.rb
koine-attributes-0.2.1 lib/koine/attributes/adapter/time.rb
koine-attributes-0.2.0 lib/koine/attributes/adapter/time.rb
koine-attributes-0.1.4 lib/koine/attributes/adapter/time.rb