Class: Jabber::FeatureNegotiation::IqFeature
- Inherits:
-
REXML::Element
- Object
- REXML::Element
- Jabber::FeatureNegotiation::IqFeature
- Defined in:
- lib/xmpp4r/feature_negotiation/iq/feature.rb
Overview
Feature negotiation, can appear as direct child to Iq or as child of IqSi
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ IqFeature
constructor
A new instance of IqFeature.
- #typed_add(element) ⇒ Object
-
#x ⇒ Object
First <x/> child with xmlns=‘jabber:x:data’.
Methods inherited from REXML::Element
#delete_elements, #first_element, #first_element_text, #import, #replace_element_text
Constructor Details
#initialize ⇒ IqFeature
Returns a new instance of IqFeature.
15 16 17 18 19 |
# File 'lib/xmpp4r/feature_negotiation/iq/feature.rb', line 15 def initialize super('feature') add_namespace 'http://jabber.org/protocol/feature-neg' end |
Class Method Details
Instance Method Details
#typed_add(element) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/xmpp4r/feature_negotiation/iq/feature.rb', line 25 def typed_add(element) if element.name == 'x' and element.namespace == 'jabber:x:data' super Dataforms::XData.new.import(element) else super element end end |
#x ⇒ Object
First <x/> child with xmlns=‘jabber:x:data’
35 36 37 38 39 40 41 |
# File 'lib/xmpp4r/feature_negotiation/iq/feature.rb', line 35 def x res = nil each_element('x') { |e| res = e if e.namespace == 'jabber:x:data' } res end |