Sha256: 3c95a652463cd7aee636db7f11a299d27f8f8fb7aa0caf5a5a67f64f541f61ad
Contents?: true
Size: 669 Bytes
Versions: 14
Compression:
Stored size: 669 Bytes
Contents
module Praxis::Mapper module Finalizable def self.extended(klass) klass.module_eval do @finalizable = Set.new end end def inherited(base) @finalizable << base base.instance_variable_set(:@finalizable, @finalizable) base.instance_variable_set(:@finalized, false) end def finalizable @finalizable end def finalized? @finalized end def _finalize! @finalized = true end def finalize! self.finalizable.reject(&:finalized?).each do |klass| klass._finalize! end self.finalize! unless self.finalizable.all?(&:finalized?) end end end
Version data entries
14 entries across 14 versions & 1 rubygems