Skip to content

Disconnect method #38

Merged
merged 1 commit into from Dec 13, 2011
+6 −0
View
6 lib/gmail.rb
@@ -105,6 +105,12 @@ def logout
@logged_in = false if res.name == 'OK'
end
end
+
+ # Shutdown socket and disconnect
+ def disconnect
+ logout if logged_in?
+ @imap.disconnect unless @imap.disconnected?
+ end
def in_mailbox(mailbox, &block)
if block_given?
Something went wrong with that request. Please try again.