Module Jabber::XParent
In: lib/xmpp4r/x.rb

Methods

x  

Public Instance methods

Get the first <x/> element in this stanza, or nil if none found.

wanted_xmlns:[String] Optional, find the first <x/> element having this xmlns,

wanted_xmlns can also be a derivate of XMPPElement from which the namespace will be taken

result:[REXML::Element] or nil

[Source]

    # File lib/xmpp4r/x.rb, line 24
24:     def x(wanted_xmlns=nil)
25:       if wanted_xmlns.kind_of? Class and wanted_xmlns.ancestors.include? XMPPElement
26:         wanted_xmlns = wanted_xmlns.new.namespace
27:       end
28: 
29:         each_element('x') { |x|
30:         if wanted_xmlns.nil? or wanted_xmlns == x.namespace
31:           return x
32:         end
33:       }
34:       nil
35:     end

[Validate]