Class Index [+]

Quicksearch

Mail::TestRetriever

Public Class Methods

emails() click to toggle source
   # File lib/mail/network/retriever_methods/test_retriever.rb, line 7
7:     def self.emails
8:       @@emails
9:     end
emails=(val) click to toggle source
    # File lib/mail/network/retriever_methods/test_retriever.rb, line 11
11:     def self.emails=(val)
12:       @@emails = val
13:     end
new(values) click to toggle source
    # File lib/mail/network/retriever_methods/test_retriever.rb, line 15
15:     def initialize(values)
16:       @@emails = []
17:     end

Public Instance Methods

find(options = {}, &block) click to toggle source
    # File lib/mail/network/retriever_methods/test_retriever.rb, line 19
19:     def find(options = {}, &block)
20:       options[:count] ||= :all
21:       options[:order] ||= :asc
22:       options[:what] ||= :first
23:       emails = @@emails.dup
24:       emails.reverse! if options[:what] == :last
25:       emails = case count = options[:count]
26:         when :all then emails
27:         when 1 then emails.first
28:         when Fixnum then emails[0, count]
29:         else
30:           raise 'Invalid count option value: ' + count.inspect
31:       end
32:       if options[:what] == :last && options[:order] == :asc || options[:what] == :first && options[:order] == :desc
33:         emails.reverse!
34:       end
35:       emails.each { |email| email.mark_for_delete = true } if options[:delete_after_find]
36:       if block_given?
37:         emails.each { |email| yield email }
38:       else
39:         emails
40:       end.tap do |results|
41:         emails.each { |email| @@emails.delete(email) if email.is_marked_for_delete? } if options[:delete_after_find]
42:       end
43:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.