Class: Blather::Stanza::PubSubOwner::Purge

Inherits:
Blather::Stanza::PubSubOwner show all
Defined in:
lib/blather/stanza/pubsub_owner/purge.rb

Constant Summary

Constants inherited from Iq

Iq::VALID_TYPES

Constants inherited from XMPPNode

XMPPNode::BASE_NAMES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Blather::Stanza::PubSubOwner

import, #inherit, #pubsub

Methods inherited from Iq

import, #type=

Methods inherited from Blather::Stanza

#as_error, attribute_helpers_for, #from, handler_list, next_id, register, #reply, #reply!, #to

Methods inherited from XMPPNode

attribute_accessor, attribute_reader, attribute_writer, class_from_registration, content_attr_accessor, content_attr_reader, content_attr_writer, #content_from, import, #inherit, #inherit_attrs, #namespace=, #namespace_href, #nokogiri_namespace=, register, #remove_child, #remove_children, #set_content_for, #to_stanza

Methods inherited from Nokogiri::XML::Node

#[]=, #attr_set, #find_first, #nokogiri_xpath, #xpath

Class Method Details

.new(type = :set, host = nil, node = nil) ⇒ Object



9
10
11
12
13
# File 'lib/blather/stanza/pubsub_owner/purge.rb', line 9

def self.new(type = :set, host = nil, node = nil)
  new_node = super(type, host)
  new_node.node = node
  new_node
end

Instance Method Details

#nodeObject



15
16
17
# File 'lib/blather/stanza/pubsub_owner/purge.rb', line 15

def node
  purge_node[:node]
end

#node=(node) ⇒ Object



19
20
21
# File 'lib/blather/stanza/pubsub_owner/purge.rb', line 19

def node=(node)
  purge_node[:node] = node
end

#purge_nodeObject



23
24
25
26
27
28
29
# File 'lib/blather/stanza/pubsub_owner/purge.rb', line 23

def purge_node
  unless purge_node = pubsub.find_first('ns:purge', :ns => self.class.registered_ns)
    self.pubsub << (purge_node = XMPPNode.new('purge', self.document))
    purge_node.namespace = self.pubsub.namespace
  end
  purge_node
end