Class: ActiveModel::Type::ImmutableString
- Defined in:
- lib/active_model/type/immutable_string.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
Methods inherited from Value
#==, #assert_valid_value, #binary?, #cast, #changed?, #changed_in_place?, #deserialize, #hash, #initialize, #map, #type_cast_for_schema
Constructor Details
This class inherits a constructor from ActiveModel::Type::Value
Instance Method Details
#serialize(value) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/active_model/type/immutable_string.rb', line 8 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 |
#type ⇒ Object
4 5 6 |
# File 'lib/active_model/type/immutable_string.rb', line 4 def type :string end |