Ruby - Metaprogramming Fundamentals
Identify the issue in this Ruby metaprogramming code:
class Sample
def self.add_method(name, &block)
define_method(name, &block)
end
add_method(:test) do
puts "Test method called"
end
end