123456789_123456789_123456789_123456789_123456789_

Class: Rinda::TupleBag::TupleBin

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Forwardable
Inherits: Object
Defined in: lib/rinda/tuplespace.rb

Class Method Summary

Instance Method Summary

Constructor Details

.newTupleBin

[ GitHub ]

  
# File 'lib/rinda/tuplespace.rb', line 295

def initialize
  @bin = []
end

Instance Method Details

#add(tuple)

[ GitHub ]

  
# File 'lib/rinda/tuplespace.rb', line 299

def add(tuple)
  @bin.push(tuple)
end

#delete(tuple)

[ GitHub ]

  
# File 'lib/rinda/tuplespace.rb', line 303

def delete(tuple)
  idx = @bin.rindex(tuple)
  @bin.delete_at(idx) if idx
end

#find

[ GitHub ]

  
# File 'lib/rinda/tuplespace.rb', line 308

def find
  @bin.reverse_each do |x|
    return x if yield(x)
  end
  nil
end