Class: Blather::Stanza::DiscoInfo::Feature

Inherits:
XMPPNode
  • Object
show all
Defined in:
lib/blather/stanza/disco/disco_info.rb

Overview

DiscoInfo::Feature

Constant Summary

Constants inherited from XMPPNode

XMPPNode::BASE_NAMES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XMPPNode

class_from_registration, #decorate, decorator_modules, import, parse, register, #to_stanza

Class Method Details

.new(node) ⇒ DiscoInfo::Feature .new(var) ⇒ DiscoInfo::Feature

Create a new DiscoInfo::Feature object

Overloads:

  • .new(node) ⇒ DiscoInfo::Feature

    Create a new Feature by importing an XML::Node

    Parameters:

    • node (XML::Node)

      an XML::Node to import

  • .new(var) ⇒ DiscoInfo::Feature

    Create a new feature by var

    Parameters:

    • var (String)

      a the Feautre’s var

Returns:



172
173
174
175
176
177
178
179
180
181
# File 'lib/blather/stanza/disco/disco_info.rb', line 172

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, *fields) ⇒ true, false

Compare two DiscoInfo::Feature objects by name, type and category

Parameters:

Returns:

  • (true, false)


198
199
200
# File 'lib/blather/stanza/disco/disco_info.rb', line 198

def eql?(o, *fields)
  super o, *(fields + [:var])
end

#varString

The Feature’s var

Returns:

  • (String)


185
186
187
# File 'lib/blather/stanza/disco/disco_info.rb', line 185

def var
  read_attr :var
end

#var=(var) ⇒ Object

Set the Feature’s var

Parameters:

  • var (String)

    the new var



191
192
193
# File 'lib/blather/stanza/disco/disco_info.rb', line 191

def var=(var)
  write_attr :var, var
end