Class Jabber::IqQueryDiscoInfo
In: lib/xmpp4r/iq/query/discoinfo.rb
Parent: IqQuery

Class for handling Service Discovery queries, info (JEP 0030)

This <query/> may contain multiple DiscoIdentity and DiscoFeature elements, describing the type and the supported namespaces of the service.

Methods

new   node   node=   set_node   typed_add  

Public Class methods

Create a new query with namespace jabber.org/protocol/disco#info

[Source]

    # File lib/xmpp4r/iq/query/discoinfo.rb, line 20
20:     def initialize
21:       super
22:       add_namespace('http://jabber.org/protocol/disco#info')
23:     end

Public Instance methods

Get the queried Service Discovery node or nil

See IqQueryDiscoItems#node for a small explanation of this.

[Source]

    # File lib/xmpp4r/iq/query/discoinfo.rb, line 51
51:     def node
52:       attributes['node']
53:     end

Get the queried Service Discovery node or nil

val:[String]

[Source]

    # File lib/xmpp4r/iq/query/discoinfo.rb, line 58
58:     def node=(val)
59:       attributes['node'] = val
60:     end

Get the queried Service Discovery node or nil (chaining-friendly)

val:[String]

[Source]

    # File lib/xmpp4r/iq/query/discoinfo.rb, line 66
66:     def set_node(val)
67:       self.node = val
68:       self
69:     end

Add a children element

Converts <identity/> elements to [DiscoIdentity] and <feature/> elements to [DiscoFeature]

[Source]

    # File lib/xmpp4r/iq/query/discoinfo.rb, line 30
30:     def typed_add(element)
31:       if element.kind_of?(REXML::Element)
32: 
33:         if element.name == 'identity'
34:           super(DiscoIdentity::new.import(element))
35:         elsif element.name == 'feature'
36:           super(DiscoFeature::new.import(element))
37:         else
38:           super(element)
39:         end
40: 
41:       else
42:         super(element)
43:       end
44:     end

[Validate]