Ruby - Classes and Objects
What will be the output of this Ruby code?
class Person
def initialize(name)
@name = name
end
def greet
"Hello, #{@name}!"
end
end
p = Person.new("Alice")
puts p.greet