Class Test

Submitted By:
david

Difficulty:
Easy

Tags:
object-oriented programming, classes

Code:
class Foo
  def name
    "foo"
  end
  
  def say_name
    "#{name}"
  end
end

class Bar < Foo
  def name
    "bar"
  end
end

assert_equal Bar.new.say_name, "___"

Your Solution

Ruby 1.9.3

Back to Problems