Sha256: 71946e8ec40d6722748beb1b639789f098d3e36b63aea1ec3128f715b6043d40

Contents?: true

Size: 356 Bytes

Versions: 3

Compression:

Stored size: 356 Bytes

Contents

# frozen_string_literal: true

module ActiveFields
  module Casters
    class DecimalArrayCaster < DecimalCaster
      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/decimal_array_caster.rb
active_fields-1.0.0 lib/active_fields/casters/decimal_array_caster.rb
active_fields-0.2.0 lib/active_fields/casters/decimal_array_caster.rb