Class: Jabber::Bytestreams::IqSi
- Inherits:
-
REXML::Element
- Object
- REXML::Element
- Jabber::Bytestreams::IqSi
- Defined in:
- lib/xmpp4r/bytestreams/iq/si.rb
Overview
Iq child ‘si’ for Stream-Initiation
Constant Summary collapse
- PROFILE_FILETRANSFER =
'http://jabber.org/protocol/si/profile/file-transfer'
Class Method Summary collapse
Instance Method Summary collapse
-
#feature ⇒ Object
- <feature/> child result
-
[IqFeature].
-
#file ⇒ Object
- <file/> child result
-
[IqSiFile].
-
#id ⇒ Object
Session ID of this stream.
-
#id=(s) ⇒ Object
Set Session ID of this stream.
-
#initialize(id = nil, profile = nil, mime_type = nil) ⇒ IqSi
constructor
A new instance of IqSi.
-
#mime_type ⇒ Object
MIME type of this stream.
-
#mime_type=(s) ⇒ Object
Set MIME type of this stream.
-
#profile ⇒ Object
Stream profile, can indicate file-transfer.
-
#profile=(s) ⇒ Object
Set stream profile.
- #typed_add(element) ⇒ Object
Methods inherited from REXML::Element
#delete_elements, #first_element, #first_element_text, #import, #replace_element_text
Constructor Details
#initialize(id = nil, profile = nil, mime_type = nil) ⇒ IqSi
Returns a new instance of IqSi.
16 17 18 19 20 21 22 23 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 16 def initialize(id=nil, profile=nil, mime_type=nil) super('si') add_namespace 'http://jabber.org/protocol/si' self.id = id self.profile = profile self.mime_type = mime_type end |
Class Method Details
Instance Method Details
#feature ⇒ Object
<feature/> child
- result
- IqFeature
85 86 87 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 85 def feature first_element('feature') end |
#file ⇒ Object
<file/> child
- result
- IqSiFile
78 79 80 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 78 def file first_element('file') end |
#id ⇒ Object
Session ID of this stream
41 42 43 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 41 def id attributes['id'] end |
#id=(s) ⇒ Object
Set Session ID of this stream
47 48 49 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 47 def id=(s) attributes['id'] = s end |
#mime_type ⇒ Object
MIME type of this stream
53 54 55 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 53 def mime_type attributes['mime-type'] end |
#mime_type=(s) ⇒ Object
Set MIME type of this stream
59 60 61 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 59 def mime_type=(s) attributes['mime-type'] = s end |
#profile ⇒ Object
Stream profile, can indicate file-transfer
65 66 67 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 65 def profile attributes['profile'] end |
#profile=(s) ⇒ Object
Set stream profile
71 72 73 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 71 def profile=(s) attributes['profile'] = s end |
#typed_add(element) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/xmpp4r/bytestreams/iq/si.rb', line 29 def typed_add(element) if element.kind_of?(REXML::Element) and element.name == 'file' super IqSiFile.new.import(element) elsif element.kind_of?(REXML::Element) and element.name == 'feature' super FeatureNegotiation::IqFeature.new.import(element) else super element end end |