P
Paul Roche
Why does the code below give me this error? What can I do to fix it?
/people3.rb:4:in `+': can't convert nil into String (TypeError)
om C:/Ruby192/people3.rb:4:in `to_s'
class Person
attr_accessor :fname, :lname, :age
def to_s
"hi " + @fname + ", " + @lname
end
end
Thanks
PR
/people3.rb:4:in `+': can't convert nil into String (TypeError)
om C:/Ruby192/people3.rb:4:in `to_s'
class Person
attr_accessor :fname, :lname, :age
def to_s
"hi " + @fname + ", " + @lname
end
end
Thanks
PR