Class: Jabber::Bytestreams::IqQueryBytestreams

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.

### Methods

activate activate= mode mode= new sid sid= streamhost_used

### Public Class methods

new(sid=nil, mode=nil)

Initialize such a <query/>

sid: | [String] Session-ID
mode: | [Symbol] :tcp or :udp

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 20
    20:       def initialize(sid=nil, mode=nil)
    21:         super()
    22:         self.sid = sid
    23:         self.mode = mode
    24:       end

### Public Instance methods

activate()

Get the text of the <activate/> child

result: | [JID] or [nil]

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 68
    68:       def activate
    69:         j = first_element_text('activate')
    70:         j ? JID.new(j) : nil
    71:       end

activate=(s)

Set the text of the <activate/> child

s: | [JID]

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 76
    76:       def activate=(s)
    77:         replace_element_text('activate', s ? s.to_s : nil)
    78:       end

mode()

Transfer mode

result: | :tcp or :udp

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 41
    41:       def mode
    42:         case attributes['mode']
    43:           when 'udp' then :udp
    44:           else :tcp
    45:         end
    46:       end

mode=(m)

Set the transfer mode

m: | :tcp or :udp

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 51
    51:       def mode=(m)
    52:         case m
    53:           when :udp then attributes['mode'] = 'udp'
    54:           else attributes['mode'] = 'tcp'
    55:         end
    56:       end

sid()

Session-ID

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 28
    28:       def sid
    29:         attributes['sid']
    30:       end

sid=(s)

Set Session-ID

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 34
    34:       def sid=(s)
    35:         attributes['sid'] = s
    36:       end

streamhost_used()

Get the <streamhost-used/> child

result: | [StreamHostUsed]

[Source]

        # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 61
    61:       def streamhost_used
    62:         first_element('streamhost-used')
    63:       end

[Validate]