Class: PDTP::Client::Callbacks
- Inherits:
-
Object
- Object
- PDTP::Client::Callbacks
- Defined in:
- lib/pdtp/client/callbacks.rb
Overview
Callbacks which can be overridden by clients to handle events
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#connected(client) ⇒ Object
Callback fired when a client has successfully connected to a server.
-
#disconnected(client) ⇒ Object
Callback fired when a client has been disconnected from a server Also fired if the connection attempt to a server fails.
-
#initialize(*args) ⇒ Callbacks
constructor
:nodoc:.
Constructor Details
#initialize(*args) ⇒ Callbacks
:nodoc:
29 30 |
# File 'lib/pdtp/client/callbacks.rb', line 29 def initialize(*args) # :nodoc: end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
27 28 29 |
# File 'lib/pdtp/client/callbacks.rb', line 27 def client @client end |
Instance Method Details
#connected(client) ⇒ Object
Callback fired when a client has successfully connected to a server
33 34 |
# File 'lib/pdtp/client/callbacks.rb', line 33 def connected(client) end |
#disconnected(client) ⇒ Object
Callback fired when a client has been disconnected from a server Also fired if the connection attempt to a server fails
38 39 40 |
# File 'lib/pdtp/client/callbacks.rb', line 38 def disconnected(client) client.stop end |