Class: MailRoom::Connection
- Inherits:
-
Object
- Object
- MailRoom::Connection
show all
- Defined in:
- lib/mail_room/connection.rb
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
#mailbox ⇒ Object
Returns the value of attribute mailbox.
5
6
7
|
# File 'lib/mail_room/connection.rb', line 5
def mailbox
@mailbox
end
|
#new_message_handler ⇒ Object
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
|
#quit ⇒ Object
24
25
26
|
# File 'lib/mail_room/connection.rb', line 24
def quit
@stopped = true
end
|
#stopped? ⇒ Boolean
16
17
18
|
# File 'lib/mail_room/connection.rb', line 16
def stopped?
@stopped
end
|
#wait ⇒ Object
20
21
22
|
# File 'lib/mail_room/connection.rb', line 20
def wait
raise NotImplementedError
end
|