| 5月 21st, 2007

破壊的メソッドを作ろうとしたら self = xxxx のようには出来ない。replace メソッドを使う。

class Array
  def add!(*vals)
    self.replace(self | vals)
  end
end

There are no comments yet, add one below.

Comments are closed.

Leave a Comment


download the hurt locker  
UA-682965-1