Class: Object

Inherits:
BasicObject
Defined in:
lib/include_complete.rb

Instance Method Summary collapse

Instance Method Details

#extend_complete(*mods) ⇒ Object

extend modules (and their singletons) into an inheritance chain

Examples:

module M
  def self.hello
    puts "hello"
  end
end
o = Object.new
o.extend_complete M
o.singleton_class.hello #=> "hello"


59
60
61
# File 'lib/include_complete.rb', line 59

def extend_complete(*mods)
  class << self; self; end.send(:include_complete, *mods)
end