Ruby | 5月 21st, 2007
破壊的メソッドを作ろうとしたら self = xxxx のようには出来ない。replace メソッドを使う。
class Array
def add!(*vals)
self.replace(self | vals)
end
end

Ruby | 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.
else : ?>Comments are closed.
