为实例变量创建 attr_reader 声明。 attr_reader 是定义读取器方法的语法糖, 它相当于编写以下内容:

class Foo
  def foo
    @foo
  end
end