Module: Enumerable

Included in:
Rant::Archive::Rubyzip::ZipCentralDirectory, Rant::Archive::Rubyzip::ZipEntrySet, Rant::FileList, Rant::IOExtras::AbstractInputStream
Defined in:
lib/rant/archive/rubyzip/stdrubyext.rb,
lib/rant/archive/rubyzip/stdrubyext.rb

Overview

:nodoc:all

Instance Method Summary collapse

Instance Method Details

#inject(n = 0) ⇒ Object


6
7
8
9
# File 'lib/rant/archive/rubyzip/stdrubyext.rb', line 6

def inject(n = 0)
  each { |value| n = yield(n, value) }
  n
end

#select_map(&aProc) ⇒ Object

returns a new array of all the return values not equal to nil This implementation could be faster


16
17
18
# File 'lib/rant/archive/rubyzip/stdrubyext.rb', line 16

def select_map(&aProc)
  map(&aProc).reject { |e| e.nil? }
end