Method: IMAPClient#initialize

Defined in:
lib/imap_client.rb

#initialize(options) ⇒ IMAPClient

Creates a new IMAPClient from options.

Options include:

+:Verbose+:: Verbose flag
+:Noop+:: Don't delete anything flag
+:Root+:: IMAP root path
+:Boxes+:: Comma-separated list of mailbox prefixes to search
+:Host+:: IMAP server
+:Port+:: IMAP server port
+:SSL+:: SSL flag
+:Username+:: IMAP username
+:Password+:: IMAP password
+:Auth+:: IMAP authentication type


203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/imap_client.rb', line 203

def initialize(options)
  @verbose = options[:Verbose]
  @noop    = options[:Noop]
  @root    = options[:Root]

  root = @root
  root += "/" unless root.empty?

  boxes = options[:Boxes].split(/,\s*/)
  @box_re = /^#{Regexp.escape root}#{Regexp.union(*boxes)}/

  connect options[:Host], options[:Port], options[:SSL],
          options[:Username], options[:Password], options[:Auth]
end