Module: Enumerable

Included in:
StringInput, TMail::AddressGroup
Defined in:
lib/tmail/compat.rb,
lib/tmail/compat.rb,
lib/tmail/compat.rb,
lib/tmail/compat.rb,
lib/tmail/mailbox.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#rejectObject


16
17
18
19
20
21
22
# File 'lib/tmail/compat.rb', line 16

def reject
  result = []
  each do |i|
    result.push i unless yield(i)
  end
  result
end

#sort_byObject


28
29
30
# File 'lib/tmail/compat.rb', line 28

def sort_by
  map {|i| [yield(i), i] }.sort.map {|val, i| i }
end