aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependency_module.rb
blob: 6847c0f86a05d8241195f7359f9ed1eae07767e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ActiveSupport
  module DependencyModule
    def append_features(base)
      return false if base < self
      (@_dependencies ||= []).each { |dep| base.send(:include, dep) }
      super
    end

    def depends_on(*mods)
      mods.each do |mod|
        next if self < mod
        @_dependencies ||= []
        @_dependencies << mod
      end
    end
  end
end