Sunday, April 6, 2008

Wish that thing in Ruby


class Array
def ||<<(i)
<< i unless include? i
end
end

Think, that would be logically appropriate, in similar to the ||= operation

No comments: