Ruby - Metaprogramming Fundamentals
What will be the output of this Ruby code?
class Demo
def self.create_method(name)
define_method(name) { "Hello, #{name}!" }
end
create_method(:greet)
end
d = Demo.new
puts d.greet