Class: Butler::IRC::Client::Listener
- Inherits:
-
Struct
- Object
- Struct
- Butler::IRC::Client::Listener
- Defined in:
- lib/butler/irc/client.rb,
lib/butler/irc/client.rb
Overview
Created by Butler::IRC::Client#subscribe() and similar methods
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#unsubscriber ⇒ Object
writeonly
Sets the attribute unsubscriber.
Instance Method Summary collapse
-
#initialize(priority, callback, args = [], &unsubscriber) ⇒ Listener
constructor
A new instance of Listener.
-
#unsubscribe ⇒ Object
will remove this listener from the clients dispatcher forever.
Constructor Details
#initialize(priority, callback, args = [], &unsubscriber) ⇒ Listener
Returns a new instance of Listener.
48 49 50 |
# File 'lib/butler/irc/client.rb', line 48 def initialize(priority, callback, args=[], &unsubscriber) super(priority, callback, args, unsubscriber) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
42 43 44 |
# File 'lib/butler/irc/client.rb', line 42 def args @args end |
#callback ⇒ Object
Returns the value of attribute callback
42 43 44 |
# File 'lib/butler/irc/client.rb', line 42 def callback @callback end |
#priority ⇒ Object
Returns the value of attribute priority
42 43 44 |
# File 'lib/butler/irc/client.rb', line 42 def priority @priority end |
#unsubscriber=(value) ⇒ Object
Sets the attribute unsubscriber
42 43 44 |
# File 'lib/butler/irc/client.rb', line 42 def unsubscriber=(value) @unsubscriber = value end |
Instance Method Details
#unsubscribe ⇒ Object
will remove this listener from the clients dispatcher forever
53 54 55 |
# File 'lib/butler/irc/client.rb', line 53 def unsubscribe unsubscriber.call(self) end |