Method: Functional::Tuple#each

Defined in:
lib/functional/tuple.rb

#each {|item| ... } ⇒ Enumerable

Calls the given block once for each element in self, passing that element as a parameter. An Enumerator is returned if no block is given.

Yield Parameters:

  • item (Object)

    the current item

Returns:

  • (Enumerable)

    when no block is given



147
148
149
150
151
152
# File 'lib/functional/tuple.rb', line 147

def each
  return enum_for(:each) unless block_given?
  @data.each do |item|
    yield(item)
  end
end