Class: Jabber::PubSub::Publish

Inherits:
XMPPElement show all
Includes:
Enumerable
Defined in:
lib/xmpp4r/pubsub/children/publish.rb

Overview

Publish

A <publish> XMPP element, see example 1 in www.xmpp.org/extensions/xep-0060.html#intro-howitworks

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

#each(&block) ⇒ Object

support for enumerating <item> elements



21
22
23
# File 'lib/xmpp4r/pubsub/children/publish.rb', line 21

def each(&block)
  items.each(&block)
end

#itemsObject

return child <item> elements



27
28
29
# File 'lib/xmpp4r/pubsub/children/publish.rb', line 27

def items
  get_elements("item")
end

#nodeObject

return the node for this publication



33
34
35
# File 'lib/xmpp4r/pubsub/children/publish.rb', line 33

def node
  attributes['node']
end