Class: Jabber::Bytestreams::IqQueryBytestreams
- Inherits:
-
IqQuery
- Object
- REXML::Element
- XMPPElement
- IqQuery
- Jabber::Bytestreams::IqQueryBytestreams
- Defined in:
- lib/xmpp4r/bytestreams/iq/bytestreams.rb
Overview
Class for accessing
Instance Method Summary collapse
-
#activate ⇒ Object
- Get the text of the
child result [JID] or [nil].
- Get the text of the
-
#activate=(s) ⇒ Object
- Set the text of the
child s [JID].
- Set the text of the
-
#initialize(sid = nil, mode = nil) ⇒ IqQueryBytestreams
constructor
- Initialize such a
sid - [String] Session-ID mode
[Symbol] :tcp or :udp.
- Initialize such a
-
#mode ⇒ Object
- Transfer mode result
:tcp or :udp.
-
#mode=(m) ⇒ Object
- Set the transfer mode m
:tcp or :udp.
-
#sid ⇒ Object
Session-ID.
-
#sid=(s) ⇒ Object
Set Session-ID.
-
#streamhost_used ⇒ Object
- Get the
child result [StreamHostUsed].
- Get the
Methods inherited from XMPPElement
class_for_name_xmlns, #clone, force_xmlns, force_xmlns?, import, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=
Methods inherited from REXML::Element
#==, #delete_elements, #each_elements, #first_element, #first_element_content, #first_element_text, #import, import, #replace_element_content, #replace_element_text, #typed_add
Constructor Details
#initialize(sid = nil, mode = nil) ⇒ IqQueryBytestreams
Initialize such a
- sid
[String] Session-ID
- mode
[Symbol] :tcp or :udp
20 21 22 23 24 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 20 def initialize(sid=nil, mode=nil) super() self.sid = sid self.mode = mode end |
Instance Method Details
#activate ⇒ Object
Get the text of the
- result
[JID] or [nil]
68 69 70 71 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 68 def activate j = first_element_text('activate') j ? JID.new(j) : nil end |
#activate=(s) ⇒ Object
Set the text of the
- s
[JID]
76 77 78 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 76 def activate=(s) replace_element_text('activate', s ? s.to_s : nil) end |
#mode ⇒ Object
Transfer mode
- result
:tcp or :udp
41 42 43 44 45 46 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 41 def mode case attributes['mode'] when 'udp' then :udp else :tcp end end |
#mode=(m) ⇒ Object
Set the transfer mode
- m
:tcp or :udp
51 52 53 54 55 56 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 51 def mode=(m) case m when :udp then attributes['mode'] = 'udp' else attributes['mode'] = 'tcp' end end |
#sid ⇒ Object
Session-ID
28 29 30 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 28 def sid attributes['sid'] end |
#sid=(s) ⇒ Object
Set Session-ID
34 35 36 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 34 def sid=(s) attributes['sid'] = s end |
#streamhost_used ⇒ Object
Get the
- result
[StreamHostUsed]
61 62 63 |
# File 'lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 61 def streamhost_used first_element('streamhost-used') end |