add(tuple)
click to toggle source
def add(tuple)
@bin.push(tuple)
end
delete(tuple)
click to toggle source
def delete(tuple)
idx = @bin.rindex(tuple)
@bin.delete_at(idx) if idx
end
find()
click to toggle source
def find
@bin.reverse_each do |x|
return x if yield(x)
end
nil
end