| Module | Sequel::Plugins::Serialization::ClassMethods |
| In: |
lib/sequel/plugins/serialization.rb
|
| deserialization_map | [R] | A hash with column name symbols and callable values, with the value called to deserialize the column. |
| serialization_map | [R] | A hash with column name symbols and callable values, with the value called to serialize the column. |
| serialization_module | [RW] | Module to store the serialized column accessor methods, so they can call be overridden and call super to get the serialization behavior |
Create instance level reader that deserializes column values on request, and instance level writer that stores new deserialized values.
# File lib/sequel/plugins/serialization.rb, line 118
118: def serialize_attributes(format, *columns)
119: if format.is_a?(Symbol)
120: unless format = REGISTERED_FORMATS[format]
121: raise(Error, "Unsupported serialization format: #{format} (valid formats: #{REGISTERED_FORMATS.keys.map{|k| k.inspect}.join})")
122: end
123: end
124: serializer, deserializer = format
125: raise(Error, "No columns given. The serialization plugin requires you specify which columns to serialize") if columns.empty?
126: define_serialized_attribute_accessor(serializer, deserializer, *columns)
127: end