Sha256: ce0160edbc568fae1e2f9eba33645cc8f5b3e31618436a03b54b146475c1df95

Contents?: true

Size: 302 Bytes

Versions: 9

Compression:

Stored size: 302 Bytes

Contents

module Koine
  module Attributes
    module Adapter
      class Date < Base
        def coerce(date)
          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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
koine-attributes-0.2.3 lib/koine/attributes/adapter/date.rb
koine-attributes-0.2.2 lib/koine/attributes/adapter/date.rb
koine-attributes-0.2.1 lib/koine/attributes/adapter/date.rb
koine-attributes-0.2.0 lib/koine/attributes/adapter/date.rb
koine-attributes-0.1.4 lib/koine/attributes/adapter/date.rb
koine-attributes-0.1.3 lib/koine/attributes/adapter/date.rb
koine-attributes-0.1.2 lib/koine/attributes/adapter/date.rb
koine-attributes-0.1.1 lib/koine/attributes/adapter/date.rb
koine-attributes-0.1.0 lib/koine/attributes/adapter/date.rb