Sha256: e3a1bd34ada4f2e23966de94e3bc0c3757b3d603233c90a90927d56254ad3310

Contents?: true

Size: 305 Bytes

Versions: 3

Compression:

Stored size: 305 Bytes

Contents

# frozen_string_literal: true

module ActiveFields
  module Casters
    class TextCaster < BaseCaster
      def serialize(value)
        cast(value)
      end

      def deserialize(value)
        cast(value)
      end

      private

      def cast(value)
        value&.to_s
      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/text_caster.rb
active_fields-1.0.0 lib/active_fields/casters/text_caster.rb
active_fields-0.2.0 lib/active_fields/casters/text_caster.rb