# File lib/mail/parts_list.rb, line 4 4: def attachments 5: Mail::AttachmentsList.new(self) 6: end
# File lib/mail/parts_list.rb, line 8
8: def collect
9: if block_given?
10: ary = PartsList.new
11: each { |o| ary << yield(o) }
12: ary
13: else
14: to_a
15: end
16: end
# File lib/mail/parts_list.rb, line 25
25: def collect!
26: raise NoMethodError, "#collect! is not defined, please call #collect and create a new PartsList"
27: end
# File lib/mail/parts_list.rb, line 21
21: def map!
22: raise NoMethodError, "#map! is not defined, please call #collect and create a new PartsList"
23: end
# File lib/mail/parts_list.rb, line 29
29: def sort!(order)
30: sorted = self.sort do |a, b|
31: # OK, 10000 is arbitrary... if anyone actually wants to explicitly sort 10000 parts of a
32: # single email message... please show me a use case and I'll put more work into this method,
33: # in the meantime, it works :)
34: a_order = order.index(a[:content_type].string.downcase) || 10000
35: b_order = order.index(b[:content_type].string.downcase) || 10000
36: a_order <=> b_order
37: end
38: self.clear
39: sorted.each { |p| self << p }
40: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.