• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/ruby-106/ruby/lib/rinda/

Lines Matching refs:tuple

27   # Raised when a hash-based tuple has an invalid key.
32 # Raised when trying to use a canceled tuple.
37 # Raised when trying to use an expired tuple.
42 # A tuple is the elementary object in Rinda programming.
43 # Tuples may be matched against templates if the tuple and
60 # The number of elements in the tuple.
63 @tuple.size
67 # Accessor method for elements of the tuple.
70 @tuple[k]
74 # Fetches item +k+ from the tuple.
77 @tuple.fetch(k)
81 # Iterate through the tuple, yielding the index or key, and the
85 if Hash === @tuple
86 @tuple.each { |k, v| yield(k, v) }
88 @tuple.each_with_index { |v, k| yield(k, v) }
93 # Return the tuple itself
95 @tuple
108 @tuple = Array.new(ary.size)
109 @tuple.size.times do |i|
110 @tuple[i] = ary[i]
118 @tuple = Hash.new
121 @tuple[k] = v
133 # Matches this template against +tuple+. The +tuple+ must be the same
136 # tuple. Elements of the template match the +tuple+ if the are #== or
148 def match(tuple)
149 return false unless tuple.respond_to?(:size)
150 return false unless tuple.respond_to?(:fetch)
151 return false unless self.size == tuple.size
154 it = tuple.fetch(k)
169 def ===(tuple)
170 match(tuple)
218 # Adds +tuple+ to the proxied TupleSpace. See TupleSpace#write.
220 def write(tuple, sec=nil)
221 @ts.write(tuple, sec)
225 # Takes +tuple+ from the proxied TupleSpace. See TupleSpace#take.
227 def take(tuple, sec=nil, &block)
229 @ts.move(DRbObject.new(port), tuple, sec, &block)
234 # Reads +tuple+ from the proxied TupleSpace. See TupleSpace#read.
236 def read(tuple, sec=nil, &block)
237 @ts.read(tuple, sec, &block)
241 # Reads all tuples matching +tuple+ from the proxied TupleSpace. See
244 def read_all(tuple)
245 @ts.read_all(tuple)
252 def notify(ev, tuple, sec=nil)
253 @ts.notify(ev, tuple, sec)