Class: Jabber::Discovery::IqQueryDiscoInfo

Inherits:
IqQuery show all
Defined in:
lib/xmpp4r/discovery/iq/discoinfo.rb

Overview

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

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

Instance Method Summary collapse

Methods inherited from XMPPElement

class_for_name_xmlns, #clone, force_xmlns, force_xmlns?, import, #initialize, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=

Methods inherited from REXML::Element

#==, #delete_elements, #each_elements, #first_element, #first_element_content, #first_element_text, #import, import, #replace_element_content, #replace_element_text, #typed_add

Constructor Details

This class inherits a constructor from Jabber::XMPPElement

Instance Method Details

#featuresObject

Get list of features

result
Array

of [String]


64
65
66
67
68
69
70
# File 'lib/xmpp4r/discovery/iq/discoinfo.rb', line 64

def features
  res = []
  each_element('feature') { |feature|
    res.push(feature.var)
  }
  res
end

#identitiesObject

Get list of identities

result
Array

of [Identity]


57
58
59
# File 'lib/xmpp4r/discovery/iq/discoinfo.rb', line 57

def identities
  get_elements('identity')
end

#identityObject

Get the first identity child

result
Identity

50
51
52
# File 'lib/xmpp4r/discovery/iq/discoinfo.rb', line 50

def identity
  first_element('identity')
end

#nodeObject

Get the queried Service Discovery node or nil

See IqQueryDiscoItems#node for a small explanation of this.


27
28
29
# File 'lib/xmpp4r/discovery/iq/discoinfo.rb', line 27

def node
  attributes['node']
end

#node=(val) ⇒ Object

Set the queried Service Discovery node or nil

val
String

34
35
36
# File 'lib/xmpp4r/discovery/iq/discoinfo.rb', line 34

def node=(val)
  attributes['node'] = val
end

#set_node(val) ⇒ Object

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

val
String

42
43
44
45
# File 'lib/xmpp4r/discovery/iq/discoinfo.rb', line 42

def set_node(val)
  self.node = val
  self
end