Public Instance methods
before_save
()
For each composition, set the columns in the model class based on the composition object.
[show source]
# File lib/sequel/plugins/composition.rb, line 154 def before_save @compositions.keys.each{|n| instance_eval(&model.compositions[n][:decomposer])} if @compositions super end
compositions
()
Cache of composition objects for this class.
[show source]
# File lib/sequel/plugins/composition.rb, line 160 def compositions @compositions ||= {} end
dup
()
Duplicate compositions hash when duplicating model instance.
[show source]
# File lib/sequel/plugins/composition.rb, line 165 def dup s = self super.instance_eval do @compositions = s.compositions.dup self end end
freeze
()
Freeze compositions hash when freezing model instance.
[show source]
# File lib/sequel/plugins/composition.rb, line 174 def freeze compositions.freeze super end