Module Sequel::Plugins::Serialization::ClassMethods
In: lib/sequel/plugins/serialization.rb

Methods

Attributes

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

Public Instance methods

Create instance level reader that deserializes column values on request, and instance level writer that stores new deserialized values.

[Source]

     # File lib/sequel/plugins/serialization.rb, line 129
129:         def serialize_attributes(format, *columns)
130:           if format.is_a?(Symbol)
131:             unless format = REGISTERED_FORMATS[format]
132:               raise(Error, "Unsupported serialization format: #{format} (valid formats: #{REGISTERED_FORMATS.keys.map{|k| k.inspect}.join})")
133:             end
134:           end
135:           serializer, deserializer = format
136:           raise(Error, "No columns given.  The serialization plugin requires you specify which columns to serialize") if columns.empty?
137:           define_serialized_attribute_accessor(serializer, deserializer, *columns)
138:         end

The columns that will be serialized. This is only for backwards compatibility, use serialization_map in new code.

[Source]

     # File lib/sequel/plugins/serialization.rb, line 142
142:         def serialized_columns
143:           serialization_map.keys
144:         end

[Validate]