Method: Net::POP3#start

Defined in:
lib/net/pop.rb

#start(account, password) ⇒ Object

Starts a POP3 session.

When called with block, gives a POP3 object to the block and closes the session after block call finishes.

This method raises a POPAuthenticationError if authentication fails.

Raises:



526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/net/pop.rb', line 526

def start(, password) # :yield: pop
  raise IOError, 'POP session already started' if @started
  if block_given?
    begin
      do_start , password
      return yield(self)
    ensure
      do_finish
    end
  else
    do_start , password
    return self
  end
end