Question from the Ruby test

Define a class foobar that inherits from Array and has a method foo.

Expert

What does the following code do?

foobar = []
class << foobar
  def foo
    "Hello World"
  end
end
Author: HivebriteStatus: PublishedQuestion passed 252 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!