Module: Enumerable

Included in:
ConfigTable, StringInput, TMail::AddressGroup, Validatable::Errors
Defined in:
lib/gems/tmail-1.2.3.1/lib/tmail/compat.rb,
lib/gems/xmpp4r-0.4/setup.rb,
lib/gems/tmail-1.2.3.1/lib/tmail/compat.rb,
lib/gems/tmail-1.2.3.1/lib/tmail/compat.rb,
lib/gems/tmail-1.2.3.1/lib/tmail/compat.rb,
lib/gems/tmail-1.2.3.1/lib/tmail/mailbox.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#rejectObject



16
17
18
19
20
21
22
# File 'lib/gems/tmail-1.2.3.1/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/gems/tmail-1.2.3.1/lib/tmail/compat.rb', line 28

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