attr_accessor & Friends

First, the manual fix β€” so it's not magic

Last lesson ended with priya.name raising NoMethodError. The direct fix is a method that just hands back the ivar:

class Walker
  def initialize(name)
    @name = name
  end

  def name
    @name
  end
end

That's it β€” name is a completely ordinary method whose body happens to be a single ivar. Now priya.name calls that method and gets "Priya" back. Nothing hidden: a "getter" in Ruby is just a method, same shape as any other.