Sha256: d96103b9c7b533821793db4ab9f8fbe239a116e237d11d74149f6af45889eb58

Contents?: true

Size: 413 Bytes

Versions: 12

Compression:

Stored size: 413 Bytes

Contents

# Abstract type for the 'temporal' family

module Attributor
  module Temporal
    extend ActiveSupport::Concern
    include Type

    module ClassMethods
      def native_type
        raise NotImplementedError
      end

      def family
        'temporal'
      end

      def dump(value, **_opts)
        value && value.iso8601
      end

      def json_schema_type
        :string
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
attributor-8.0 lib/attributor/families/temporal.rb
attributor-7.1 lib/attributor/families/temporal.rb
attributor-7.0 lib/attributor/families/temporal.rb
attributor-6.5 lib/attributor/families/temporal.rb
attributor-6.4 lib/attributor/families/temporal.rb
attributor-6.3 lib/attributor/families/temporal.rb
attributor-6.2 lib/attributor/families/temporal.rb
attributor-6.1 lib/attributor/families/temporal.rb
attributor-6.0 lib/attributor/families/temporal.rb
attributor-5.7 lib/attributor/families/temporal.rb
attributor-5.6 lib/attributor/families/temporal.rb
attributor-5.5 lib/attributor/families/temporal.rb