Support for the Ruby 2.1 series ended on March 31 2017. See here for details.

In Files

  • rinda/tuplespace.rb

Parent

Rinda::TupleBag::TupleBin

Public Class Methods

new() click to toggle source
 
               # File rinda/tuplespace.rb, line 295
def initialize
  @bin = []
end
            

Public Instance Methods

add(tuple) click to toggle source
 
               # File rinda/tuplespace.rb, line 299
def add(tuple)
  @bin.push(tuple)
end
            
delete(tuple) click to toggle source
 
               # File rinda/tuplespace.rb, line 303
def delete(tuple)
  idx = @bin.rindex(tuple)
  @bin.delete_at(idx) if idx
end
            
find() click to toggle source
 
               # File rinda/tuplespace.rb, line 308
def find
  @bin.reverse_each do |x|
    return x if yield(x)
  end
  nil
end