Class: Adhearsion::XMPP

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::Autoload
Defined in:
lib/adhearsion/xmpp.rb,
lib/adhearsion/xmpp/plugin.rb,
lib/adhearsion/xmpp/version.rb,
lib/adhearsion/xmpp/connection.rb

Overview

Adhearsion Plugin that defines the XMPP configuration options and includes a hook to start the XMPP service in Adhearsion initialization process

Defined Under Namespace

Classes: Connection, Plugin

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.method_missing(m, *args, &block) ⇒ Object



32
33
34
# File 'lib/adhearsion/xmpp.rb', line 32

def method_missing(m, *args, &block)
  plugin.connection.send m, *args, &block
end

.register_handlers(&block) ⇒ Object

Raises:

  • (ArgumentError)


18
19
20
21
22
23
24
25
26
27
28
# File 'lib/adhearsion/xmpp.rb', line 18

def register_handlers(&block)
  raise ArgumentError, "You must supply a block" unless block_given?
  self.handlers ||= ThreadSafeArray.new
  handlers << block
  handlers.each do |handler|
    unless plugin.nil?
      # Plugin has already initialized.  Add these handlers directly.
      plugin.connection.instance_eval &handler
    end
  end
end