Module: AgentXmpp::Xmpp::XParent

Included in:
Message, Presence
Defined in:
lib/agent_xmpp/xmpp/x_data.rb

Overview


Instance Method Summary collapse

Instance Method Details

#x(wanted_xmlns = nil) ⇒ Object

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



17
18
19
20
21
22
# File 'lib/agent_xmpp/xmpp/x_data.rb', line 17

def x(wanted_xmlns=nil)
  if wanted_xmlns.kind_of? Class and wanted_xmlns.ancestors.include? Element
    wanted_xmlns = wanted_xmlns.new.namespace
  end
  elements.to_a('x').select{|x| wanted_xmlns.nil? or wanted_xmlns == x.namespace}.first
end