Class: Jabber::Callback

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/xmpp4r/lib/xmpp4r/callbacks.rb

Overview

This class is used to store callbacks inside CallbackList. See the CallbackList class for more detailed explanations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(priority = 0, ref = nil, block = Proc.new {}) ⇒ Callback

Create a new callback

priority
Integer

the callback’s priority. The higher, the sooner it

will be executed

ref
String

The callback’s reference



118
119
120
121
122
# File 'lib/vendor/xmpp4r/lib/xmpp4r/callbacks.rb', line 118

def initialize(priority = 0, ref = nil, block = Proc.new {})
  @priority = priority
  @ref = ref
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

The Callback’s block to execute



111
112
113
# File 'lib/vendor/xmpp4r/lib/xmpp4r/callbacks.rb', line 111

def block
  @block
end

#priorityObject (readonly)

The Callback’s priority



105
106
107
# File 'lib/vendor/xmpp4r/lib/xmpp4r/callbacks.rb', line 105

def priority
  @priority
end

#refObject (readonly)

The Callback’s reference, using for deleting purposes



108
109
110
# File 'lib/vendor/xmpp4r/lib/xmpp4r/callbacks.rb', line 108

def ref
  @ref
end