Class: Blather::Stanza::Iq::Si::Si
- Defined in:
- lib/blather/stanza/iq/si.rb
Overview
Si stanza fragment
Defined Under Namespace
Constant Summary
Constants inherited from XMPPNode
Class Method Summary collapse
-
.find_or_create(parent) ⇒ Si::Si
Find or create si node in Si Iq and converts it to Si::Si.
-
.new(node = nil) ⇒ Si::Si
Create a new Si::Si object.
Instance Method Summary collapse
-
#feature ⇒ Si::Si::Feature
Find or create feature node.
-
#file ⇒ Si::Si::File
Find or create file node.
-
#id ⇒ String?
Get the id of the stream.
-
#id=(id) ⇒ Object
Set the id.
-
#mime_type ⇒ String?
Get the MIME type of the stream.
-
#mime_type=(type) ⇒ Object
Set the MIME type.
-
#profile ⇒ String?
Get the profile of the stream.
-
#profile=(profile) ⇒ Object
Set the profile.
Methods inherited from XMPPNode
class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza
Class Method Details
.find_or_create(parent) ⇒ Si::Si
Find or create si node in Si Iq and converts it to Si::Si
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/blather/stanza/iq/si.rb', line 103 def self.find_or_create(parent) if found_si = parent.find_first('//ns:si', :ns => NS_SI) si = self.new found_si found_si.remove else si = self.new end parent << si si end |
Instance Method Details
#feature ⇒ Si::Si::Feature
Find or create feature node
167 168 169 |
# File 'lib/blather/stanza/iq/si.rb', line 167 def feature Feature.find_or_create self end |
#file ⇒ Si::Si::File
Find or create file node
160 161 162 |
# File 'lib/blather/stanza/iq/si.rb', line 160 def file File.find_or_create self end |
#id ⇒ String?
Get the id of the stream
118 119 120 |
# File 'lib/blather/stanza/iq/si.rb', line 118 def id read_attr :id end |
#id=(id) ⇒ Object
Set the id
125 126 127 |
# File 'lib/blather/stanza/iq/si.rb', line 125 def id=(id) write_attr :id, id end |
#mime_type ⇒ String?
Get the MIME type of the stream
132 133 134 |
# File 'lib/blather/stanza/iq/si.rb', line 132 def mime_type read_attr 'mime-type' end |
#mime_type=(type) ⇒ Object
Set the MIME type
139 140 141 |
# File 'lib/blather/stanza/iq/si.rb', line 139 def mime_type=(type) write_attr 'mime-type', type end |
#profile ⇒ String?
Get the profile of the stream
146 147 148 |
# File 'lib/blather/stanza/iq/si.rb', line 146 def profile read_attr :profile end |
#profile=(profile) ⇒ Object
Set the profile
153 154 155 |
# File 'lib/blather/stanza/iq/si.rb', line 153 def profile=(profile) write_attr :profile, profile end |