Method: Rinda::Tuple#each

Defined in:
lib/rinda/rinda.rb

#eachObject

Iterate through the tuple, yielding the index or key, and the value, thus ensuring arrays are iterated similarly to hashes.



86
87
88
89
90
91
92
# File 'lib/rinda/rinda.rb', line 86

def each # FIXME
  if Hash === @tuple
    @tuple.each { |k, v| yield(k, v) }
  else
    @tuple.each_with_index { |v, k| yield(k, v) }
  end
end