Class Jabber::Protocol::Iq
In: lib/jabber4r/protocol.rb
Parent: Object

A class used to build/parse IQ requests/responses

Methods
from_element    gen_add_rosteritem    gen_auth    gen_auth_digest    gen_oob    gen_registration    gen_roster    gen_vcard    get_private    new    reply    send    to_s    to_xml   
Attributes
:data  [RW] 
:error  [RW] 
:errorcode  [RW] 
:from  [RW] 
:id  [RW] 
:session  [RW] 
:to  [RW] 
:type  [RW] 
:xmlns  [RW] 
Public Class methods
from_element(session, element)

Factory to build an IQ object from xml element

session:[Jabber::Session] The Jabber session instance
element:[Jabber::Protocol::ParsedXMLElement] The received XML object
return:[Jabber::Protocol::Iq] The newly created Iq object
new(session,id=nil)

Default constructor to build an Iq object

session:[Jabber::Session] The Jabber session instance
id:[String=nil] The (optional) id of the Iq object
get_private(session,id,ename,ns)

Return an IQ object that uses the jabber:iq:private namespace

gen_roster(session, id)

Generates an IQ roster request XML element

id:[String] The message id
return:[String] The XML data to send
gen_registration(session, id, username, password, email, name)

Generates an IQ authortization request XML element

id:[String] The message id
username:[String] The username
password:[String] The password
email:[String] The email address of the account
name:[String] The full name
return:[String] The XML data to send
gen_add_rosteritem(session, id, jid, name)

Generates an IQ Roster Item add request XML element

session:[Session] The session
id:[String] The message id
jid:[JID] The Jabber ID to add to the roster
name:[String] The full name
return:[String] The XML data to send
gen_auth(session, id, username, password, resource)

Generates an IQ authortization request XML element

id:[String] The message id
username:[String] The username
password:[String] The password
resource:[String] The resource to bind this session to
return:[String] The XML data to send
gen_auth_digest(session, id, username, digest, resource)

Generates an IQ digest authortization request XML element

id:[String] The message id
username:[String] The username
digest:[String] The SHA-1 hash of the sessionid and the password
resource:[String] The resource to bind this session to
return:[String] The XML data to send
gen_oob(session, to, url, desc="")

Generates an IQ out of bounds XML element

to:[JID] The Jabber ID to send to
url:[String] The data to send
desc:[String=""] The description of the data
return:[String] The XML data to send
gen_vcard(session, id, to)

Generates an VCard request XML element

id:[String] The message ID
to:[JID] The jabber id of the account to get the VCard for
return:[String] The XML data to send
Public Instance methods
send(wait=false, &block)

Sends the IQ to the Jabber service for delivery

wait:[Boolean = false] Wait for reply before return?
&block:[Block] A block to process the message replies
reply()

Builds a reply to an existing Iq

return:[Jabber::Protocol::Iq] The result Iq
to_xml()

Generates XML that complies with the Jabber protocol for sending the Iq through the Jabber service.

return:[String] The XML string.
to_s()

see to_xml