Sha256: 3a9ec2481e297e542af584bbd29580542b001b9c1dc624d434c82cf14c8a5052

Contents?: true

Size: 350 Bytes

Versions: 3

Compression:

Stored size: 350 Bytes

Contents

# frozen_string_literal: true

module ActiveFields
  module Casters
    class DateArrayCaster < DateCaster
      def serialize(value)
        return unless value.is_a?(Array)

        value.map { super(_1) }
      end

      def deserialize(value)
        return unless value.is_a?(Array)

        value.map { super(_1) }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_fields-1.1.0 lib/active_fields/casters/date_array_caster.rb
active_fields-1.0.0 lib/active_fields/casters/date_array_caster.rb
active_fields-0.2.0 lib/active_fields/casters/date_array_caster.rb