Class: Blather::Stanza::Iq::S5b::StreamHostUsed
- Inherits:
-
XMPPNode
- Object
- Niceogiri::XML::Node
- XMPPNode
- Blather::Stanza::Iq::S5b::StreamHostUsed
- Defined in:
- lib/blather/stanza/iq/s5b.rb
Overview
Stream host used stanza
Constant Summary
Constants inherited from XMPPNode
Class Method Summary collapse
-
.new(jid) ⇒ Object
Create a new S5b::StreamHostUsed.
Instance Method Summary collapse
-
#jid ⇒ Blather::JID?
Get the jid of the used streamhost.
-
#jid=(j) ⇒ Object
Set the jid of the used streamhost.
Methods inherited from XMPPNode
class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza
Class Method Details
.new(node) ⇒ Object .new(opts) ⇒ Object .new(jid) ⇒ Object
Create a new S5b::StreamHostUsed
173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/blather/stanza/iq/s5b.rb', line 173 def self.new(jid) new_node = super 'streamhost-used' case jid when Nokogiri::XML::Node new_node.inherit jid when Hash new_node.jid = jid[:jid] else new_node.jid = jid end new_node end |
Instance Method Details
#jid ⇒ Blather::JID?
Get the jid of the used streamhost
190 191 192 193 194 195 196 |
# File 'lib/blather/stanza/iq/s5b.rb', line 190 def jid if j = read_attr(:jid) JID.new(j) else nil end end |
#jid=(j) ⇒ Object
Set the jid of the used streamhost
201 202 203 |
# File 'lib/blather/stanza/iq/s5b.rb', line 201 def jid=(j) write_attr :jid, (j ? j.to_s : nil) end |