Thursday, October 29, 2009

Ruby initialize puzzle (question part)

There are classes and module like below:
class Foo
  def initialize(a)
    puts "Hello #{a}"
  end
end
module Bar
  def initialize(b)
    puts "#{b} World"
  end
end
class Sample < Foo
  include Bar
  def initialize(c)
    super
  end
end

When you call Sample.new('qux'), what standard output will you see?

No comments:

Post a Comment