class Mail::Retriever
def all(options = nil, &block)
order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.
Possible options:
Get all emails.
def all(options = nil, &block) options = options ? Hash[options] : {} options[:count] = :all find(options, &block) end
def find_and_delete(options = nil, &block)
is true. Call #find if you would like this to default to false.
delete_after_find: flag for whether to delete each retreived email after find. Default
instance of Message, not an array of Message instances.
count: number of emails to retrieve. The default value is 10. A value of 1 returns an
order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.
what: last or first emails. The default is :first.
Possible options:
five last received emails are returned.
Find emails in the mailbox, and then deletes them. Without any options, the
def find_and_delete(options = nil, &block) options = options ? Hash[options] : {} options[:delete_after_find] ||= true find(options, &block) end
def first(options = nil, &block)
order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.
count: number of emails to retrieve. The default value is 1.
Possible options:
Get the oldest received email(s)
def first(options = nil, &block) options = options ? Hash[options] : {} options[:what] = :first options[:count] ||= 1 find(options, &block) end
def last(options = nil, &block)
order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.
count: number of emails to retrieve. The default value is 1.
Possible options:
Get the most recent received email(s)
def last(options = nil, &block) options = options ? Hash[options] : {} options[:what] = :last options[:count] ||= 1 find(options, &block) end