Class/Module Index [+]

Quicksearch

Sequel::Plugins::Serialization::ClassMethods

Attributes

serialization_map[R]

A map of the serialized columns for this model. Keys are column symbols, values are serialization formats (:marshal, :yaml, or :json).

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

inherited(subclass) click to toggle source

Copy the serialization format and columns to serialize into the subclass.

# File lib/sequel/plugins/serialization.rb, line 56
def inherited(subclass)
  super
  sm = serialization_map.dup
  subclass.instance_eval{@serialization_map = sm}
end
serialization_format() click to toggle source

The first value in the serialization map. This is only for backwards compatibility, use serialization_map in new code.

# File lib/sequel/plugins/serialization.rb, line 64
def serialization_format
  serialization_map.values.first
end
serialize_attributes(format, *columns) click to toggle source

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

# File lib/sequel/plugins/serialization.rb, line 71
def serialize_attributes(format, *columns)
  raise(Error, "Unsupported serialization format (#{format}), should be :marshal, :yaml, or :json") unless [:marshal, :yaml, :json].include?(format)
  raise(Error, "No columns given.  The serialization plugin requires you specify which columns to serialize") if columns.empty?
  define_serialized_attribute_accessor(format, *columns)
end
serialized_columns() click to toggle source

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

# File lib/sequel/plugins/serialization.rb, line 79
def serialized_columns
  serialization_map.keys
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.