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