Class: Blather::Stanza::Iq::Si
- Inherits:
-
Blather::Stanza::Iq
- Object
- Niceogiri::XML::Node
- XMPPNode
- Blather::Stanza
- Blather::Stanza::Iq
- Blather::Stanza::Iq::Si
- Defined in:
- lib/blather/stanza/iq/si.rb
Overview
# Si Stanza
[XEP-0096: SI File Transfer](xmpp.org/extensions/xep-0096.html)
This is a base class for any si based Iq stanzas. It provides a base set of methods for working with si stanzas
Defined Under Namespace
Classes: Si
Constant Summary collapse
- NS_SI =
'http://jabber.org/protocol/si'
Constants inherited from Blather::Stanza::Iq
Constants inherited from XMPPNode
Instance Attribute Summary
Attributes inherited from Blather::Stanza
Class Method Summary collapse
-
.new(type = :set) ⇒ Object
Overrides the parent method to ensure a si node is created.
Instance Method Summary collapse
-
#inherit(node) ⇒ Object
Overrides the parent method to ensure the current si node is destroyed.
-
#reply ⇒ Object
Overrides the parent method to ensure the current si node is destroyed.
-
#si ⇒ Si::Si
Find or create si node.
-
#si=(node) ⇒ Si::Si
Replaces si 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!, #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 = :set) ⇒ Object
Overrides the parent method to ensure a si node is created
43 44 45 46 47 |
# File 'lib/blather/stanza/iq/si.rb', line 43 def self.new(type = :set) node = super node.si node end |
Instance Method Details
#inherit(node) ⇒ Object
Overrides the parent method to ensure the current si node is destroyed
52 53 54 55 |
# File 'lib/blather/stanza/iq/si.rb', line 52 def inherit(node) si.remove super end |
#reply ⇒ Object
Overrides the parent method to ensure the current si node is destroyed
78 79 80 81 82 |
# File 'lib/blather/stanza/iq/si.rb', line 78 def reply reply = Stanza::Iq::Si.import super reply.si.remove reply end |
#si ⇒ Si::Si
Find or create si node
60 61 62 |
# File 'lib/blather/stanza/iq/si.rb', line 60 def si Si.find_or_create self end |
#si=(node) ⇒ Si::Si
Replaces si node
69 70 71 72 73 |
# File 'lib/blather/stanza/iq/si.rb', line 69 def si=(node) si.remove self << node Si.find_or_create self end |