我创建了一个对象,我想基于一些条件检查,为这个对象添加一些属性.我怎样才能做到这一点?解释我想要的东西:
A=Object.new if(something happens) { #make A have another attibute say age #& store something in A.age }
ruby
ruby ×1