1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
module Feature
module ClassMethods
def feature
end
end
# in uber, this would look somehow like
# module Feature
# module ClassMethods ... end
# extend Uber::InheritableIncluded
# inheritable_included do |includer|
# includer.extend ClassMethods
# end
# end
InheritedIncludedCodeBlock = lambda do |includer|
includer.extend ClassMethods
end
module RecursiveIncluded
def included(includer)
#super # TODO: test me.
puts "RecursiveIncluded in #{includer}"
includer.module_eval do
InheritedIncludedCodeBlock.call(includer)
extend RecursiveIncluded
end
end
end
extend RecursiveIncluded
end
module Client
include Feature
end
module Extension
include Client
end
module Plugin
include Extension
end
module Framework
include Plugin
end
Client.feature
Extension.feature
Plugin.feature
Framework.feature
|