Class: Gmailish::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/gmailish/actions.rb

Constant Summary collapse

INBOX =
'inbox'

Instance Attribute Summary collapse

Instance Method Summary collapse

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(, username, password)
  @account = 
  @username = username
  @password = password
  @logged_in = false
end

Instance Attribute Details

#logged_inObject

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

Returns:

  • (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?
    
    inbox
    yield
    logout
  else
    raise Error::NoMessageError, "Messages must be passed within a block."
  end
end