Parent

Class Index [+]

Quicksearch

Mail::PartsList

Public Instance Methods

attachments() click to toggle source
   # File lib/mail/parts_list.rb, line 4
4:     def attachments
5:       Mail::AttachmentsList.new(self)
6:     end
collect() click to toggle source
    # 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
Also aliased as: map
collect!() click to toggle source
    # 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
map() click to toggle source
Alias for: collect
map!() click to toggle source
    # 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
sort!(order) click to toggle source
    # 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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.