Ruby - Advanced Metaprogramming
Identify the problem in this Ruby code:
class User
def initialize(name)
@name = name
end
end
user = User.new('Alice')
user.instance_eval do
def greet
"Hello, #{@name}!"
end
end
puts user.greet