Class: Gmail::Client::Plain
Constant Summary
Constants inherited from Base
Base::GMAIL_IMAP_HOST, Base::GMAIL_IMAP_PORT, Base::GMAIL_SMTP_HOST, Base::GMAIL_SMTP_PORT
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(username, password, options = {}) ⇒ Plain
constructor
A new instance of Plain.
- #login(raise_errors = false) ⇒ Object
Methods inherited from Base
#compose, #connect, #connect!, #connection, #deliver, #deliver!, #fill_username, #inbox, #inspect, #labels, #logged_in?, #login!, #logout, #mail_domain, #mailbox, #mailboxes
Constructor Details
#initialize(username, password, options = {}) ⇒ Plain
Returns a new instance of Plain.
6 7 8 9 |
# File 'lib/gmail/client/plain.rb', line 6 def initialize(username, password, ={}) @password = password super(username, ) end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/gmail/client/plain.rb', line 4 def password @password end |
Instance Method Details
#login(raise_errors = false) ⇒ Object
11 12 13 14 15 |
# File 'lib/gmail/client/plain.rb', line 11 def login(raise_errors=false) @imap and @logged_in = (login = @imap.login(username, password)) && login.name == 'OK' rescue Net::IMAP::NoResponseError raise_errors and raise AuthorizationError, "Couldn't login to given GMail account: #{username}" end |