Class: Blather::Stanza::DiscoItems
- Inherits:
-
Disco
- Object
- Niceogiri::XML::Node
- XMPPNode
- Blather::Stanza
- Iq
- Iq::Query
- Disco
- Blather::Stanza::DiscoItems
- Defined in:
- lib/blather/stanza/disco/disco_items.rb
Overview
# DiscoItems Stanza
[XEP-0030 Disco Info](xmpp.org/extensions/xep-0030.html#items)
Disco Items node that provides or retreives items associated with a jabbery entity
Defined Under Namespace
Classes: Item
Constant Summary
Constants inherited from Iq
Constants inherited from XMPPNode
Instance Attribute Summary
Attributes inherited from Blather::Stanza
Class Method Summary collapse
-
.new(type = nil, node = nil, items = []) ⇒ Blather::Stanza::DiscoItems
Create a new DiscoItems node.
Instance Method Summary collapse
-
#items ⇒ Array<Blather::Stanza::DiscoItems::Item>
Set of items associated with the node.
-
#items=(items) ⇒ Object
Add an array of items.
Methods inherited from Disco
Methods inherited from Iq::Query
Methods inherited from Iq
#error?, #get?, import, #reply!, #result?, #set?, #type=
Methods inherited from Blather::Stanza
#as_error, #error?, #from, #from=, handler_list, #id, #id=, #initialize, next_id, register, #reply, #reply!, #to, #to=, #type, #type=
Methods inherited from XMPPNode
class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza
Constructor Details
This class inherits a constructor from Blather::Stanza
Class Method Details
.new(type = nil, node = nil, items = []) ⇒ Blather::Stanza::DiscoItems
Create a new DiscoItems node
21 22 23 24 25 26 |
# File 'lib/blather/stanza/disco/disco_items.rb', line 21 def self.new(type = nil, node = nil, items = []) new_node = super type new_node.node = node new_node.items = [items] new_node end |
Instance Method Details
#items ⇒ Array<Blather::Stanza::DiscoItems::Item>
Set of items associated with the node
31 32 33 34 35 |
# File 'lib/blather/stanza/disco/disco_items.rb', line 31 def items query.find('//ns:item', :ns => self.class.registered_ns).map do |i| Item.new i end end |