Module: Blather::Stanza::Presence::C::InstanceMethods
- Included in:
- Blather::Stanza::Presence::C
- Defined in:
- lib/blather/stanza/presence/c.rb
Instance Method Summary collapse
-
#c ⇒ Blather::XMPPNode
C node accessor If a c node exists it will be returned.
-
#hash ⇒ Symbol?
Get the name of the hash.
-
#hash=(hash) ⇒ Object
Set the name of the hash.
- #inherit(node) ⇒ Object
-
#node ⇒ String?
Get the name of the node.
-
#node=(node) ⇒ Object
Set the name of the node.
-
#ver ⇒ String?
Get the ver.
-
#ver=(ver) ⇒ Object
Set the ver.
Instance Method Details
#c ⇒ Blather::XMPPNode
C node accessor If a c node exists it will be returned. Otherwise a new node will be created and returned
87 88 89 90 91 92 93 |
# 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 ⇒ Symbol?
Get the name of the hash
54 55 56 |
# File 'lib/blather/stanza/presence/c.rb', line 54 def hash c[:hash] && c[:hash].to_sym end |
#hash=(hash) ⇒ Object
Set the name of the hash
61 62 63 64 65 66 |
# 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) ⇒ Object
31 32 33 34 35 |
# File 'lib/blather/stanza/presence/c.rb', line 31 def inherit(node) c.remove super self end |
#node ⇒ String?
Get the name of the node
40 41 42 |
# File 'lib/blather/stanza/presence/c.rb', line 40 def node c[:node] end |
#node=(node) ⇒ Object
Set the name of the node
47 48 49 |
# File 'lib/blather/stanza/presence/c.rb', line 47 def node=(node) c[:node] = node end |
#ver ⇒ String?
Get the ver
71 72 73 |
# File 'lib/blather/stanza/presence/c.rb', line 71 def ver c[:ver] end |
#ver=(ver) ⇒ Object
Set the ver
78 79 80 |
# File 'lib/blather/stanza/presence/c.rb', line 78 def ver=(ver) c[:ver] = ver end |