Class: MailRoom::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/mail_room/connection.rb

Direct Known Subclasses

IMAP::Connection, MicrosoftGraph::Connection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mailbox) ⇒ Connection

Returns a new instance of Connection.



7
8
9
10
# File 'lib/mail_room/connection.rb', line 7

def initialize(mailbox)
  @mailbox = mailbox
  @stopped = false
end

Instance Attribute Details

#mailboxObject (readonly)

Returns the value of attribute mailbox.



5
6
7
# File 'lib/mail_room/connection.rb', line 5

def mailbox
  @mailbox
end

#new_message_handlerObject (readonly)

Returns the value of attribute new_message_handler.



5
6
7
# File 'lib/mail_room/connection.rb', line 5

def new_message_handler
  @new_message_handler
end

Instance Method Details

#on_new_message(&block) ⇒ Object



12
13
14
# File 'lib/mail_room/connection.rb', line 12

def on_new_message(&block)
  @new_message_handler = block
end

#quitObject



24
25
26
# File 'lib/mail_room/connection.rb', line 24

def quit
  @stopped = true
end

#stopped?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/mail_room/connection.rb', line 16

def stopped?
  @stopped
end

#waitObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/mail_room/connection.rb', line 20

def wait
  raise NotImplementedError
end