Sha256: 76d2964f6116ab9e28f824ffa17478ad9431001e9735d9350cb6719b7c436c82
Contents?: true
Size: 606 Bytes
Versions: 22
Compression:
Stored size: 606 Bytes
Contents
# frozen_string_literal: true module ActiveModel module Type class ImmutableString < Value # :nodoc: def type :string end def serialize(value) case value when ::Numeric, ActiveSupport::Duration then value.to_s when true then "t" when false then "f" else super end end private def cast_value(value) result = \ case value when true then "t" when false then "f" else value.to_s end result.freeze end end end end
Version data entries
22 entries across 22 versions & 1 rubygems