Class: Jabber::Caps::C
- Inherits:
-
XMPPElement
- Object
- REXML::Element
- XMPPElement
- Jabber::Caps::C
- Defined in:
- lib/xmpp4r/caps/c.rb
Overview
The <c/> XMPP element, used to advertise entity capabilities.
See www.xmpp.org/extensions/xep-0115.html#protocol.
You should not need to construct this element directly, see Jabber::Caps::Helper.
Instance Method Summary collapse
-
#ext ⇒ Object
Get the value of this element’s ‘ext’ attribute, the list of extensions for legacy clients.
-
#hash ⇒ Object
Get the value of this element’s ‘hash’ attribute, the algorithm used in generating the ‘ver’ attribute.
-
#initialize(node = nil, ver = nil) ⇒ C
constructor
A new instance of C.
-
#legacy? ⇒ Boolean
Is this a legacy caps response, as defined by version 1.3 of the XEP-0115 specification?.
-
#node ⇒ Object
Get the value of this element’s ‘node’ attribute, a ‘unique identifier for the software underlying the entity’.
-
#ver ⇒ Object
Get the value of this element’s ‘ver’ attribute, an opaque hash representing this entity’s capabilities.
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, #each_elements, #first_element, #first_element_content, #first_element_text, #import, import, #replace_element_content, #replace_element_text, #typed_add
Constructor Details
#initialize(node = nil, ver = nil) ⇒ C
Returns a new instance of C.
22 23 24 25 26 27 28 29 |
# File 'lib/xmpp4r/caps/c.rb', line 22 def initialize(node = nil, ver = nil) super() add_attribute('node', node) if node if ver add_attribute('ver', ver) add_attribute('hash', 'sha-1') end end |
Instance Method Details
#ext ⇒ Object
Get the value of this element’s ‘ext’ attribute, the list of extensions for legacy clients.
55 56 57 |
# File 'lib/xmpp4r/caps/c.rb', line 55 def ext attributes['ext'] end |
#hash ⇒ Object
Get the value of this element’s ‘hash’ attribute, the algorithm used in generating the ‘ver’ attribute
48 49 50 |
# File 'lib/xmpp4r/caps/c.rb', line 48 def hash attributes['hash'] end |
#legacy? ⇒ Boolean
Is this a legacy caps response, as defined by version 1.3 of the XEP-0115 specification?
62 63 64 |
# File 'lib/xmpp4r/caps/c.rb', line 62 def legacy? hash.nil? || hash.empty? end |
#node ⇒ Object
Get the value of this element’s ‘node’ attribute, a ‘unique identifier for the software underlying the entity’
41 42 43 |
# File 'lib/xmpp4r/caps/c.rb', line 41 def node attributes['node'] end |
#ver ⇒ Object
Get the value of this element’s ‘ver’ attribute, an opaque hash representing this entity’s capabilities.
34 35 36 |
# File 'lib/xmpp4r/caps/c.rb', line 34 def ver attributes['ver'] end |