Sha256: df849ece5e956330d3192bad01adfab4766994e1cd8d8b2c27cc07d12f8b9aa0

Contents?: true

Size: 1.34 KB

Versions: 18

Compression:

Stored size: 1.34 KB

Contents

# =XMPP4R - XMPP Library for Ruby
# License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
# Website::http://home.gna.org/xmpp4r/

require 'xmpp4r/xmppelement'

module Jabber
  module Caps
    NS_CAPS='http://jabber.org/protocol/caps'

    ##
    # The <c/> XMPP element, used to advertise entity capabilities.
    #
    # See http://www.xmpp.org/extensions/xep-0115.html#protocol.
    #
    # You should not need to construct this element directly, see
    # Jabber::Caps::Helper.
    class C < XMPPElement
      name_xmlns 'c', NS_CAPS
      force_xmlns true

      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

      ##
      # Get the value of this element's 'ver' attribute,
      # an opaque hash representing this entity's capabilities.
      def ver
        attributes['ver']
      end

      ##
      # Get the value of this element's 'node' attribute,
      # a 'unique identifier for the software underlying the entity'
      def node
        attributes['node']
      end

      ##
      # Get the value of this element's 'hash' attribute,
      # the algorithm used in generating the 'ver' attribute
      def hash
        attributes['hash']
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 7 rubygems

Version Path
bryanl-xmpp4r-0.3.2 lib/xmpp4r/caps/c.rb
edavey-xmpp4r-0.4.1 lib/xmpp4r/caps/c.rb
edavey-xmpp4r-0.4.2 lib/xmpp4r/caps/c.rb
edavey-xmpp4r-0.4 lib/xmpp4r/caps/c.rb
heipei-xmpp4r-0.3.2 lib/xmpp4r/caps/c.rb
cerberus-0.8.0 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7.9 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
edavis10-cerberus-0.7.8 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7.8 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7.7 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7.6 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7.2 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7.5 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
cerberus-0.7 lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb
mack-notifier-0.8.3 lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/c.rb
mack-notifier-0.8.2 lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/c.rb
mack-notifier-0.8.3.1 lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/c.rb
xmpp4r-0.4 lib/xmpp4r/caps/c.rb