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
- .new ⇒ TupleBin constructor
Instance Method Summary
Constructor Details
.new ⇒ TupleBin
# File 'lib/rinda/tuplespace.rb', line 294
def initialize @bin = [] end
Instance Method Details
#add(tuple)
[ GitHub ]# File 'lib/rinda/tuplespace.rb', line 298
def add(tuple) @bin.push(tuple) end
#delete(tuple)
[ GitHub ]# File 'lib/rinda/tuplespace.rb', line 302
def delete(tuple) idx = @bin.rindex(tuple) @bin.delete_at(idx) if idx end
#find
[ GitHub ]# File 'lib/rinda/tuplespace.rb', line 307
def find @bin.reverse_each do |x| return x if yield(x) end nil end