Class: Blather::Stanza::Presence::C

Inherits:
Blather::Stanza::Presence show all
Includes:
InstanceMethods
Defined in:
lib/blather/stanza/presence/c.rb

Overview

# Entity Capabilities Stanza

[XEP-0115 - Entity Capabilities](http://xmpp.org/extensions/xep-0115.html)

Blather handles c nodes through this class. It provides a set of helper methods to quickly deal with capabilites presence stanzas.

Defined Under Namespace

Modules: InstanceMethods

Constant Summary collapse

VALID_HASH_TYPES =
%w[md2 md5 sha-1 sha-224 sha-256 sha-384 sha-512].freeze

Constants inherited from Blather::Stanza::Presence

VALID_TYPES

Constants inherited from XMPPNode

XMPPNode::BASE_NAMES

Instance Attribute Summary

Attributes inherited from Blather::Stanza

#handler_hierarchy

Class Method Summary collapse

Methods included from InstanceMethods

#c, #hash, #hash=, #inherit, #node, #node=, #ver, #ver=

Methods inherited from Blather::Stanza::Presence

#error?, import, #probe?, #subscribe?, #subscribed?, #type=, #unavailable?, #unsubscribe?, #unsubscribed?

Methods inherited from Blather::Stanza

#as_error, #error?, #from, #from=, handler_list, #id, #id=, #initialize, next_id, register, #reply, #reply!, #to, #to=, #type, #type=

Methods inherited from XMPPNode

class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza

Constructor Details

This class inherits a constructor from Blather::Stanza

Class Method Details

.new(node = nil, ver = nil, hash = 'sha-1') ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/blather/stanza/presence/c.rb', line 19

def self.new(node = nil, ver = nil, hash = 'sha-1')
  new_node = super()
  new_node.c
  new_node.hash = hash
  new_node.node = node
  new_node.ver = ver
  parse new_node.to_xml
end