Class: Jabber::PubSub::SubscriptionConfig

Inherits:
Configuration show all
Defined in:
lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb

Overview

SubscriptionConfig

An <options> XMPP element, see example 57 in www.xmpp.org/extensions/xep-0060.html#subscriber-configure-success

Instance Method Summary collapse

Methods inherited from Configuration

#form, #form=, #node, #node=, #options, #options=

Methods inherited from XMPPElement

class_for_name_xmlns, #clone, force_xmlns, force_xmlns?, import, 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

#initialize(node = nil, jid = nil, options = nil, subid = nil) ⇒ SubscriptionConfig

Construct a new Options stanza

node
String

the node to which this subscription applies

jid
String

or [Jabber::JID] the jid that holds the subscription

options
Hash

the configuration for this subscription

subid
String

(optional) subscription id



25
26
27
28
29
30
31
32
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb', line 25

def initialize(node = nil, jid = nil, options = nil, subid = nil)
  super()

  self.node = node
  self.jid = jid
  self.options = options
  self.subid = subid
end

Instance Method Details

#jidObject

get the ‘jid’ attribute for this stanza



43
44
45
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb', line 43

def jid
  attributes['jid'] ? Jabber::JID.new(attributes['jid']) : nil
end

#jid=(jid) ⇒ Object

set the ‘jid’ attribute of this stanza

jid
Jabber::JID

or [String] the jid owning the subscription



37
38
39
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb', line 37

def jid=(jid)
  attributes['jid'] = jid.to_s
end

#subidObject

get the ‘subid’ attribute



56
57
58
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb', line 56

def subid
  attributes['subid']
end

#subid=(subid) ⇒ Object

set the ‘subid’ attribute

subid
String

the subscription id



50
51
52
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb', line 50

def subid=(subid)
  attributes['subid'] = subid
end