Skip to content

Instantly share code, notes, and snippets.

@dangjlin
Created June 22, 2015 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangjlin/8407550ceb7fe040599d to your computer and use it in GitHub Desktop.
Save dangjlin/8407550ceb7fe040599d to your computer and use it in GitHub Desktop.
module ActiveSupport
module Concern
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)
# ...
end
end
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment