📜  ruby attr_writer 示例 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:49.935000             🧑  作者: Mango

代码示例1
class Person
  attr_reader :name, :age, :sex, :email
  attr_writer :name, :age, :sex, :email

  def initialize(name)
    @name = name
  end
end