Sha256: 11a94c2b7002930d190d82f2030f12d144f0d874ac12e06717cb2c34afd805b6

Contents?: true

Size: 350 Bytes

Versions: 2

Compression:

Stored size: 350 Bytes

Contents

# frozen_string_literal: true

module ActiveFields
  module Casters
    class EnumArrayCaster < EnumCaster
      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

2 entries across 2 versions & 1 rubygems

Version Path
active_fields-1.1.0 lib/active_fields/casters/enum_array_caster.rb
active_fields-1.0.0 lib/active_fields/casters/enum_array_caster.rb