Sha256: c77830deeddc2ab22f2b8f043b0fba57924a838d0d7199649420f811390c12d3
Contents?: true
Size: 607 Bytes
Versions: 53
Compression:
Stored size: 607 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
53 entries across 53 versions & 8 rubygems