Method: Mail::Retriever#last

Defined in:
lib/mail/network/retriever_methods/base.rb

#last(options = nil, &block) ⇒ Object

Get the most recent received email(s)

Possible options:

count: number of emails to retrieve. The default value is 1.
order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.


27
28
29
30
31
32
# File 'lib/mail/network/retriever_methods/base.rb', line 27

def last(options = nil, &block)
  options = options ? Hash[options] : {}
  options[:what] = :last
  options[:count] ||= 1
  find(options, &block)
end