Class: Butler::IRC::Client::Listener

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(priority, callback, args = [], &unsubscriber) ⇒ Listener

Returns a new instance of Listener.



46
47
48
# File 'lib/butler/irc/client.rb', line 46

def initialize(priority, callback, args=[], &unsubscriber)
	super(priority, callback, args, unsubscriber)
end

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



40
41
42
# File 'lib/butler/irc/client.rb', line 40

def args
  @args
end

#callbackObject

Returns the value of attribute callback

Returns:

  • (Object)

    the current value of callback



40
41
42
# File 'lib/butler/irc/client.rb', line 40

def callback
  @callback
end

#priorityObject

Returns the value of attribute priority

Returns:

  • (Object)

    the current value of priority



40
41
42
# File 'lib/butler/irc/client.rb', line 40

def priority
  @priority
end

#unsubscriber=(value) ⇒ Object

Sets the attribute unsubscriber

Parameters:

  • value (Object)

    the value to set the attribute unsubscriber to.

Returns:

  • (Object)

    the newly set value



40
41
42
# File 'lib/butler/irc/client.rb', line 40

def unsubscriber=(value)
  @unsubscriber = value
end

Instance Method Details

#unsubscribeObject

will remove this listener from the clients dispatcher forever



51
52
53
# File 'lib/butler/irc/client.rb', line 51

def unsubscribe
	unsubscriber.call(self)
end