Including Modules

Submitted By:
david

Difficulty:
Easy

Tags:
classes, modules

Code:
module A
  def name
    "a"
  end
end

module B
  def name
    "b"
  end
end

class C
  include A
  include B
end

class D
  include B, A
end

assert_equal C.new.name, "___"
assert_equal D.new.name, "___"

Your Solution

Ruby 1.9.3

Back to Problems