Sha256: 7d61c5878f994bc79a58bb829d3ad798014cc4d9969bc6c543ac881cd2411f1b

Contents?: true

Size: 853 Bytes

Versions: 13

Compression:

Stored size: 853 Bytes

Contents

module ActiveSupport
  module Concern
    def self.extended(base)
      base.instance_variable_set("@_dependencies", [])
    end

    def append_features(base)
      if base.instance_variable_defined?("@_dependencies")
        base.instance_variable_get("@_dependencies") << self
        return false
      else
        return false if base < self
        @_dependencies.each { |dep| base.send(:include, dep) }
        super
        base.extend const_get("ClassMethods") if const_defined?("ClassMethods")
        base.send :include, const_get("InstanceMethods") if const_defined?("InstanceMethods")
        base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block")
      end
    end

    def included(base = nil, &block)
      if base.nil?
        @_included_block = block
      else
        super
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
activesupport-3.0.0.rc lib/active_support/concern.rb
csd-0.1.5 lib/active_support/concern.rb
csd-0.1.4 lib/active_support/concern.rb
csd-0.1.3 lib/active_support/concern.rb
csd-0.1.2 lib/active_support/concern.rb
csd-0.1.1 lib/active_support/concern.rb
csd-0.1.0 lib/active_support/concern.rb
csd-0.0.16 lib/active_support/concern.rb
activesupport-3.0.0.beta4 lib/active_support/concern.rb
activesupport-3.0.0.beta3 lib/active_support/concern.rb
activesupport-3.0.0.beta2 lib/active_support/concern.rb
activesupport-3.0.0.beta lib/active_support/concern.rb
activesupport-3.0.pre lib/active_support/concern.rb