Class: Gmailish::Actions
- Inherits:
-
Object
- Object
- Gmailish::Actions
- Defined in:
- lib/gmailish/actions.rb
Constant Summary collapse
- INBOX =
'inbox'
Instance Attribute Summary collapse
-
#logged_in ⇒ Object
Returns the value of attribute logged_in.
Instance Method Summary collapse
-
#initialize(account, username, password) ⇒ Actions
constructor
A new instance of Actions.
- #logged_in? ⇒ Boolean
- #process(&block) ⇒ Object
Constructor Details
#initialize(account, username, password) ⇒ Actions
Returns a new instance of Actions.
7 8 9 10 11 12 |
# File 'lib/gmailish/actions.rb', line 7 def initialize(account, username, password) @account = account @username = username @password = password @logged_in = false end |
Instance Attribute Details
#logged_in ⇒ Object
Returns the value of attribute logged_in.
3 4 5 |
# File 'lib/gmailish/actions.rb', line 3 def logged_in @logged_in end |
Instance Method Details
#logged_in? ⇒ Boolean
25 26 27 |
# File 'lib/gmailish/actions.rb', line 25 def logged_in? logged_in end |
#process(&block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gmailish/actions.rb', line 14 def process(&block) if block_given? login inbox yield logout else raise Error::NoMessageError, "Messages must be passed within a block." end end |