Class: Blather::Stanza::DiscoInfo::Feature
- Inherits:
-
XMPPNode
- Object
- Nokogiri::XML::Node
- XMPPNode
- Blather::Stanza::DiscoInfo::Feature
- Defined in:
- lib/blather/stanza/disco/disco_info.rb
Overview
Identity
Constant Summary
Constants inherited from XMPPNode
Class Method Summary collapse
-
.new(var) ⇒ DiscoInfo::Feature
Create a new DiscoInfo::Feature object.
Instance Method Summary collapse
-
#eql?(o) ⇒ true, false
(also: #==)
Compare two Feature objects by var.
-
#var ⇒ String
The Feature’s var.
-
#var=(var) ⇒ Object
Set the Feature’s var.
Methods inherited from XMPPNode
class_from_registration, #content_from, import, #inherit, #inherit_attrs, #inspect, #namespace=, #namespace_href, #nokogiri_namespace=, #read_attr, #read_content, register, #remove_child, #remove_children, #set_content_for, #to_stanza, #write_attr
Methods inherited from Nokogiri::XML::Node
#[]=, #attr_set, #find_first, #nokogiri_xpath, #xpath
Class Method Details
.new(node) ⇒ DiscoInfo::Feature .new(var) ⇒ DiscoInfo::Feature
Create a new DiscoInfo::Feature object
156 157 158 159 160 161 162 163 164 165 |
# File 'lib/blather/stanza/disco/disco_info.rb', line 156 def self.new(var) new_node = super :feature case var when Nokogiri::XML::Node new_node.inherit var else new_node.var = var end new_node end |
Instance Method Details
#eql?(o) ⇒ true, false Also known as: ==
Compare two Feature objects by var
182 183 184 185 186 187 188 |
# File 'lib/blather/stanza/disco/disco_info.rb', line 182 def eql?(o) unless o.is_a?(self.class) raise "Cannot compare #{self.class} with #{o.class}" end o.var == self.var end |
#var ⇒ String
The Feature’s var
169 170 171 |
# File 'lib/blather/stanza/disco/disco_info.rb', line 169 def var read_attr :var end |
#var=(var) ⇒ Object
Set the Feature’s var
175 176 177 |
# File 'lib/blather/stanza/disco/disco_info.rb', line 175 def var=(var) write_attr :var, var end |