Class: Blather::Stanza::Iq::Vcard
- Inherits:
-
Blather::Stanza::Iq
- Object
- Niceogiri::XML::Node
- XMPPNode
- Blather::Stanza
- Blather::Stanza::Iq
- Blather::Stanza::Iq::Vcard
- Defined in:
- lib/blather/stanza/iq/vcard.rb
Overview
# Vcard Stanza
[XEP-0054 vcard-temp](xmpp.org/extensions/xep-0054.html)
This is a base class for any vcard based Iq stanzas. It provides a base set of methods for working with vcard stanzas
Defined Under Namespace
Classes: Vcard
Constant Summary
Constants inherited from Blather::Stanza::Iq
Constants inherited from XMPPNode
Instance Attribute Summary
Attributes inherited from Blather::Stanza
Class Method Summary collapse
-
.new(type = nil, to = nil, id = nil) ⇒ Object
Overrides the parent method to ensure a vcard node is created.
Instance Method Summary collapse
-
#inherit(node) ⇒ Object
Overrides the parent method to ensure the current vcard node is destroyed.
-
#vcard ⇒ Vcard::Vcard
Find or create vcard node.
-
#vcard=(info) ⇒ Vcard::Vcard
Replaces vcard node.
Methods inherited from Blather::Stanza::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
.new(type = nil, to = nil, id = nil) ⇒ Object
Overrides the parent method to ensure a vcard node is created
39 40 41 42 43 |
# File 'lib/blather/stanza/iq/vcard.rb', line 39 def self.new(type = nil, to = nil, id = nil) node = super node.vcard node end |
Instance Method Details
#inherit(node) ⇒ Object
Overrides the parent method to ensure the current vcard node is destroyed
48 49 50 51 52 |
# File 'lib/blather/stanza/iq/vcard.rb', line 48 def inherit(node) vcard.remove super self end |
#vcard ⇒ Vcard::Vcard
Find or create vcard node
57 58 59 |
# File 'lib/blather/stanza/iq/vcard.rb', line 57 def vcard Vcard.find_or_create self end |
#vcard=(info) ⇒ Vcard::Vcard
Replaces vcard node
66 67 68 69 70 |
# File 'lib/blather/stanza/iq/vcard.rb', line 66 def vcard=(info) vcard.remove self << info Vcard.find_or_create self end |