class Rinda::TupleBag::TupleBin
公共类方法
new() 点击以切换源代码
# File rinda-0.2.0/lib/rinda/tuplespace.rb, line 294 def initialize @bin = [] end
公共实例方法
add(tuple) 点击以切换源代码
# File rinda-0.2.0/lib/rinda/tuplespace.rb, line 298 def add(tuple) @bin.push(tuple) end
delete(tuple) 点击以切换源代码
# File rinda-0.2.0/lib/rinda/tuplespace.rb, line 302 def delete(tuple) idx = @bin.rindex(tuple) @bin.delete_at(idx) if idx end
find() { |x| ... } 点击以切换源代码
# File rinda-0.2.0/lib/rinda/tuplespace.rb, line 307 def find @bin.reverse_each do |x| return x if yield(x) end nil end