Class: AgentXmpp::Xmpp::IqPubSubOwner

Inherits:
Element show all
Defined in:
lib/agent_xmpp/xmpp/iq_pubsub.rb

Overview


Class Method Summary collapse

Methods inherited from Element

#<<, class_for_name_xmlns, #clone, import, #initialize, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=, xmpp_attribute, xmpp_child

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 AgentXmpp::Xmpp::Element

Class Method Details

.delete_node(pipe, to, node) ⇒ Object

.….….….….….….….….….….….….….….….….….….….….….….….….….….



122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/agent_xmpp/xmpp/iq_pubsub.rb', line 122

def delete_node(pipe, to, node)
  iq = Xmpp::Iq.new(:set, to)  
  delete = REXML::Element.new('delete')
  delete.add_attribute('node', node) 
  iq.pubsub = IqPubSubOwner.new << delete
  Send(iq) do |r|
    if r.type == :result and r.kind_of?(Xmpp::Iq)
      pipe.broadcast_to_delegates(:on_pubsub_delete_node_result, pipe, r, node)
    elsif r.type.eql?(:error)
      pipe.broadcast_to_delegates(:on_pubsub_delete_node_error, pipe, r, node)
    end
  end     
end