Method: Module#is
- Defined in:
- lib/core/facets/module/is.rb
#is(*mods) ⇒ Object
An alias for #include.
class IsExample
is Enumerable
end
CREDIT: Trans
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/core/facets/module/is.rb', line 25 def is(*mods) mods.each do |mod| if mod.const_defined?(:Self) extend mod::Self # pass it along if module if instance_of?(Module) const_set(:Self, Module.new) unless const_defined?(:Self) const_get(:Self).send(:include, mod::Self) end end end include(*mods) end |