Class: Blather::Stanza::Iq::Si::Si::Feature
- Inherits:
-
XMPPNode
- Object
- Niceogiri::XML::Node
- XMPPNode
- Blather::Stanza::Iq::Si::Si::Feature
- Defined in:
- lib/blather/stanza/iq/si.rb
Overview
Feature stanza fragment
Constant Summary
Constants inherited from XMPPNode
Class Method Summary collapse
-
.find_or_create(parent) ⇒ Si::Si::Feature
Find or create feature node in si node and converts it to Si::Si::Feature.
-
.new(node = nil) ⇒ Si::Si::Feature
Create a new Si::Si::Feature object.
Instance Method Summary collapse
-
#x ⇒ Stanza::X
Find or create x node.
Methods inherited from XMPPNode
class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza
Class Method Details
.find_or_create(parent) ⇒ Si::Si::Feature
Find or create feature node in si node and converts it to Si::Si::Feature
192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/blather/stanza/iq/si.rb', line 192 def self.find_or_create(parent) if found_feature = parent.find_first('//ns:feature', :ns => self.registered_ns) feature = self.new found_feature found_feature.remove else feature = self.new end parent << feature feature end |
.new(node = nil) ⇒ Si::Si::Feature
Create a new Si::Si::Feature object
180 181 182 183 184 185 |
# File 'lib/blather/stanza/iq/si.rb', line 180 def self.new(node = nil) new_node = super :feature new_node.namespace = self.registered_ns new_node.inherit node if node new_node end |
Instance Method Details
#x ⇒ Stanza::X
Find or create x node
207 208 209 |
# File 'lib/blather/stanza/iq/si.rb', line 207 def x Stanza::X.find_or_create self end |