Module: Enumerable
- Included in:
- Amp::Changeset, Amp::Merges::MergeState, Amp::Revlog, Amp::RevlogSupport::Index, Archive::Tar::Minitar::Input, BZ2::Reader, IOExtras::AbstractInputStream, RubyPriorityQueue, Zip::ZipCentralDirectory, Zip::ZipEntrySet, Zip::ZipFileSystem::ZipFileNameMapper, Zip::ZipFileSystem::ZipFsDirIterator
- Defined in:
- lib/amp/dependencies/zip/stdrubyext.rb,
lib/amp/dependencies/zip/stdrubyext.rb
Instance Method Summary collapse
- #inject(n = 0) ⇒ Object
-
#select_map(&aProc) ⇒ Object
returns a new array of all the return values not equal to nil This implementation could be faster.
Instance Method Details
#inject(n = 0) ⇒ Object
3 4 5 6 |
# File 'lib/amp/dependencies/zip/stdrubyext.rb', line 3 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
13 14 15 |
# File 'lib/amp/dependencies/zip/stdrubyext.rb', line 13 def select_map(&aProc) map(&aProc).reject { |e| e.nil? } end |