Sha256: 2586c7efad570e6869a13e231ffa348180f1a30b7bc39e1a1aa6f384bf9bfff9

Contents?: true

Size: 370 Bytes

Versions: 3

Compression:

Stored size: 370 Bytes

Contents

require 'activefacts/metamodel'

module ActiveFacts
  module TraitInjector
    def self.included other
      overlap = Metamodel.constants & other.constants
      overlap.each do |const|
        mix_into = Metamodel.const_get(const)
        mix_in = other.const_get(const)
        mix_into.instance_exec {
          include(mix_in)
        }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activefacts-generators-1.9.2 lib/activefacts/generators/helpers/inject.rb
activefacts-generators-1.9.1 lib/activefacts/generators/helpers/inject.rb
activefacts-generators-1.9.0 lib/activefacts/generators/helpers/inject.rb