Class: Blather::Stanza::Capabilities

Inherits:
DiscoInfo show all
Defined in:
lib/blather/stanza/disco/capabilities.rb

Overview

# Capabilities Stanza

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

XMPP protocol extension for broadcasting and dynamically discovering client, device, or generic entity capabilities.

Constant Summary

Constants inherited from Iq

Iq::VALID_TYPES

Constants inherited from XMPPNode

XMPPNode::BASE_NAMES

Instance Attribute Summary

Attributes inherited from Blather::Stanza

#handler_hierarchy

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DiscoInfo

#eql?, #features, #identities

Methods inherited from Disco

#eql?, #node

Methods inherited from Iq::Query

#inherit, #query

Methods inherited from Iq

#error?, #get?, import, #reply!, #result?, #set?, #type=

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

.newObject



11
12
13
# File 'lib/blather/stanza/disco/capabilities.rb', line 11

def self.new
  super :result
end

Instance Method Details

#cBlather::Stanza::Presence::C

The generated Presence::C node



48
49
50
# File 'lib/blather/stanza/disco/capabilities.rb', line 48

def c
  Blather::Stanza::Presence::C.new @bare_node, ver
end

#features=(features) ⇒ Object

Add an array of features

Parameters:

  • features

    the array of features, passed directly to Feature.new



40
41
42
43
# File 'lib/blather/stanza/disco/capabilities.rb', line 40

def features=(features)
  super features
  regenerate_full_node
end

#identities=(identities) ⇒ Object

Add an array of identities

Parameters:

  • identities

    the array of identities, passed directly to Identity.new



33
34
35
36
# File 'lib/blather/stanza/disco/capabilities.rb', line 33

def identities=(identities)
  super identities
  regenerate_full_node
end

#node=(node) ⇒ Object

A URI that uniquely identifies a software application, typically a URL at the website of the project or company that produces the software.

Parameters:

  • node (String)

    the node URI



26
27
28
29
# File 'lib/blather/stanza/disco/capabilities.rb', line 26

def node=(node)
  @bare_node = node
  super "#{node}##{ver}"
end

#verString

A string that is used to verify the identity and supported features of the entity.

Returns:

  • (String)


18
19
20
# File 'lib/blather/stanza/disco/capabilities.rb', line 18

def ver
  generate_ver identities, features
end