module Tacit::Inheritance
Public Instance Methods
As(base)
click to toggle source
# File lib/tacit/inheritance.rb, line 12 def As(base) if nebulous? base::Combines(*extentions) else base * self end end
Combines(*from, &block)
click to toggle source
# File lib/tacit/inheritance.rb, line 4 def Combines(*from, &block) if nebulous? Module.new(&block).include(*from, *extentions) else Module.new(&block).include(*from, self) end end
Overlays(base)
click to toggle source
# File lib/tacit/inheritance.rb, line 24 def Overlays(base) if nebulous? base::With(*extentions) else base << self end end
With(*overlayers)
click to toggle source
# File lib/tacit/inheritance.rb, line 32 def With(*overlayers) if nebulous? prepend(*overlayers) else Module.new.prepend(*overlayers, self) end end
as_base_class()
click to toggle source
# File lib/tacit/inheritance.rb, line 20 def as_base_class As(Class.new) end
extentions()
click to toggle source
# File lib/tacit/inheritance.rb, line 40 def extentions; ancestors.tap { |a| a.delete self } end
nebulous?()
click to toggle source
# File lib/tacit/inheritance.rb, line 41 def nebulous?; name.nil? && instance_methods(false).empty? end