Class: Jabber::PubSub::Configuration
- Inherits:
-
XMPPElement
- Object
- REXML::Element
- XMPPElement
- Jabber::PubSub::Configuration
- Defined in:
- lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#form ⇒ Object
get the underlying XData form element.
- #form=(form) ⇒ Object
-
#form_type ⇒ Object
Implemented by NodeConfig and SubscriptionConfig.
- #node ⇒ Object
- #node=(node) ⇒ Object
-
#options ⇒ Object
- get a list of the configured options represented by this stanza return
- Hash
-
the options and their values.
- #options=(options) ⇒ Object
Methods inherited from XMPPElement
class_for_name_xmlns, #clone, force_xmlns, force_xmlns?, import, #initialize, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=
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 Jabber::XMPPElement
Instance Method Details
#form ⇒ Object
get the underlying XData form element
14 15 16 17 18 19 20 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 14 def form children.each do |c| return c if c.kind_of?(Jabber::Dataforms::XData) end nil end |
#form=(form) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 22 def form=(form) children.each do |c| delete_element(c) if c.kind_of?(Jabber::Dataforms::XData) delete(c) end end add(form) end |
#form_type ⇒ Object
Implemented by NodeConfig and SubscriptionConfig
33 34 35 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 33 def form_type '' end |
#node ⇒ Object
62 63 64 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 62 def node attributes['node'] end |
#node=(node) ⇒ Object
58 59 60 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 58 def node=(node) attributes['node'] = node end |
#options ⇒ Object
get a list of the configured options represented by this stanza
- return
- Hash
-
the options and their values
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 46 def = {} if !form.nil? form.fields.each do |f| f.values.size == 1 ? [f.var] = f.values.first : [f.var] = f.values end end end |
#options=(options) ⇒ Object
37 38 39 40 41 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb', line 37 def () if self.form = ( form_type, ) end end |