| Class | Jabber::Bytestreams::IqQueryBytestreams |
| In: |
lib/xmpp4r/bytestreams/iq/bytestreams.rb
|
| Parent: | IqQuery |
Class for accessing <query/> elements with xmlns=’jabber.org/protocol/bytestreams’ in <iq/> stanzas.
| NS_BYTESTREAMS | = | 'http://jabber.org/protocol/bytestreams' |
Initialize such a <query/>
| sid: | [String] Session-ID |
| mode: | [Symbol] :tcp or :udp |
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 18
18: def initialize(sid=nil, mode=nil)
19: super()
20: add_namespace(IqQueryBytestreams::NS_BYTESTREAMS)
21: self.sid = sid
22: self.mode = mode
23: end
Transfer mode
| result: | :tcp or :udp |
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 50
50: def mode
51: case attributes['mode']
52: when 'udp' then :udp
53: else :tcp
54: end
55: end
Set the transfer mode
| m: | :tcp or :udp |
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 60
60: def mode=(m)
61: case m
62: when :udp then attributes['mode'] = 'udp'
63: else attributes['mode'] = 'tcp'
64: end
65: end
Session-ID
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 37
37: def sid
38: attributes['sid']
39: end
Set Session-ID
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 43
43: def sid=(s)
44: attributes['sid'] = s
45: end
Get the <streamhost-used/> child
| result: | [StreamHostUsed] |
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 70
70: def streamhost_used
71: first_element('streamhost-used')
72: end
# File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 25
25: def typed_add(xe)
26: if xe.kind_of?(REXML::Element) and xe.name == 'streamhost'
27: super StreamHost.new.import(xe)
28: elsif xe.kind_of?(REXML::Element) and xe.name == 'streamhost-used'
29: super StreamHostUsed.new.import(xe)
30: else
31: super xe
32: end
33: end