Class: Jabber::Discovery::IqQueryDiscoItems

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

Overview

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

This <query/> may contain multiple Item elements, describing multiple services to be browsed by Jabber clients. These may then get further information about these items by querying IqQueryDiscoInfo and further sub-items by querying IqQueryDiscoItems.

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, #first_element, #first_element_text, #import, import, #replace_element_text, #typed_add

Constructor Details

This class inherits a constructor from Jabber::XMPPElement

Instance Method Details

#itemsObject

Get all item children

result

Array of [Discovery::Item]



51
52
53
# File 'lib/vendor/xmpp4r/lib/xmpp4r/discovery/iq/discoitems.rb', line 51

def items
  get_elements('item')
end

#nodeObject

Get the queried Service Discovery node or nil

A Service Discovery node is not a JID node, this may be a bit confusing. It’s just to make Service Discovery browsing a bit more structured.



30
31
32
# File 'lib/vendor/xmpp4r/lib/xmpp4r/discovery/iq/discoitems.rb', line 30

def node
  attributes['node']
end

#node=(val) ⇒ Object

Get the queried Service Discovery node or nil



36
37
38
# File 'lib/vendor/xmpp4r/lib/xmpp4r/discovery/iq/discoitems.rb', line 36

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

#set_node(val) ⇒ Object

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



43
44
45
46
# File 'lib/vendor/xmpp4r/lib/xmpp4r/discovery/iq/discoitems.rb', line 43

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