📜  ruby 创建具有属性的对象 - Ruby 代码示例

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

代码示例1
class MyObject
  attr_accessor :attribute1, :attribute2, :attribute3
end

test_object = MyObject.new
test_object.attribute1 = "Holy cow!"