module Blather::Stanza::Presence::C::InstanceMethods

Public Instance Methods

c() click to toggle source

C node accessor If a c node exists it will be returned. Otherwise a new node will be created and returned

@return [Blather::XMPPNode]

# File lib/blather/stanza/presence/c.rb, line 87
def c
  unless c = find_first('ns:c', :ns => C.registered_ns)
    self << (c = XMPPNode.new('c', self.document))
    c.namespace = self.class.registered_ns
  end
  c
end
hash() click to toggle source

Get the name of the hash

@return [Symbol, nil]

# File lib/blather/stanza/presence/c.rb, line 54
def hash
  c[:hash] && c[:hash].to_sym
end
hash=(hash) click to toggle source

Set the name of the hash

@param [String, nil] hash the new hash name

# File lib/blather/stanza/presence/c.rb, line 61
def hash=(hash)
  if hash && !VALID_HASH_TYPES.include?(hash.to_s)
    raise ArgumentError, "Invalid Hash Type (#{hash}), use: #{VALID_HASH_TYPES*' '}"
  end
  c[:hash] = hash
end
inherit(node) click to toggle source

@private

Calls superclass method
# File lib/blather/stanza/presence/c.rb, line 31
def inherit(node)
  c.remove
  super
  self
end
node() click to toggle source

Get the name of the node

@return [String, nil]

# File lib/blather/stanza/presence/c.rb, line 40
def node
  c[:node]
end
node=(node) click to toggle source

Set the name of the node

@param [String, nil] node the new node name

# File lib/blather/stanza/presence/c.rb, line 47
def node=(node)
  c[:node] = node
end
ver() click to toggle source

Get the ver

@return [String, nil]

# File lib/blather/stanza/presence/c.rb, line 71
def ver
  c[:ver]
end
ver=(ver) click to toggle source

Set the ver

@param [String, nil] ver the new ver

# File lib/blather/stanza/presence/c.rb, line 78
def ver=(ver)
  c[:ver] = ver
end