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:



174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/blather/stanza/disco/disco_info.rb', line 174

def self.new(var)
  return var if var.class == self

  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)


202
203
204
# File 'lib/blather/stanza/disco/disco_info.rb', line 202

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

#varString

The Feature’s var

Returns:

  • (String)


189
190
191
# File 'lib/blather/stanza/disco/disco_info.rb', line 189

def var
  read_attr :var
end

#var=(var) ⇒ Object

Set the Feature’s var

Parameters:

  • var (String)

    the new var



195
196
197
# File 'lib/blather/stanza/disco/disco_info.rb', line 195

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