class Foo
  def do_stuff
    puts "doing stuff"
  end
end

module Wrapper
  def do_stuff
    puts "before stuff"
    super
    puts "after stuff"
  end
end

class Foo
  prepend Wrapper
end

Foo.new.do_stuff
p Foo.ancestors

output:
=======
before stuff
doing stuff
after stuff
[Wrapper, Foo, Object, Kernel, BasicObject]
#----------------------------

class Foo
  def do_stuff
    puts "doing stuff"
  end
end

module Wrapper
  def do_stuff
    puts "before stuff"
    super
    puts "after stuff"
  end
end

class Foo
  include Wrapper
end

Foo.new.do_stuff
p Foo.ancestors

output:
=======
before stuff
doing stuff
after stuff
[Wrapper, Foo, Object, Kernel, BasicObject]

I didn't get the technical difference between these two. Any one please
help me.

-- 
Posted via http://www.ruby-forum.com/.