class Jabber::Discovery::Identity

Service Discovery identity to add() to IqQueryDiscoInfo

Please note that XEP 0030 requires both category and type to occur, for a reference see: www.xmpp.org/registrar/disco-categories.html

Public Class Methods

new(category=nil, iname=nil, type=nil) click to toggle source

Initialize a new Identity

category
String

Initial category or nil

iname
String

Initial identity name or nil

type
String

Initial type or nil

Calls superclass method
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 87
def initialize(category=nil, iname=nil, type=nil)
  super()
  set_category(category)
  set_iname(iname)
  set_type(type)
end

Public Instance Methods

category() click to toggle source

Get the identity's category or nil

result
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 97
def category
  attributes['category']
end
category=(val) click to toggle source

Set the identity's category

Service Discovery categories should be somewhat standardized by some registry, so clients may represent specific categories by specific icons… (see www.jabber.org/registrar/disco-categories.html)

val
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 109
def category=(val)
  attributes['category'] = val
end
iname() click to toggle source

Get the identity's name or nil

This has been renamed from <name/> to “iname” here to keep REXML::Element#name accessible

result
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 127
def iname
  attributes['name']
end
iname=(val) click to toggle source

Set the identity's name

val
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 134
def iname=(val)
  attributes['name'] = val
end
set_category(val) click to toggle source

Set the identity's category (chaining-friendly)

val
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 116
def set_category(val)
  self.category = val
  self
end
set_iname(val) click to toggle source

Set the identity's name (chaining-friendly)

val
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 141
def set_iname(val)
  self.iname = val
  self
end
set_type(val) click to toggle source

Set the identity's type (chaining-friendly)

val
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 164
def set_type(val)
  self.type = val
  self
end
type() click to toggle source

Get the identity's type or nil

result
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 149
def type
  attributes['type']
end
type=(val) click to toggle source

Set the identity's type (see www.jabber.org/registrar/disco-categories.html)

val
String
# File lib/xmpp4r/discovery/iq/discoinfo.rb, line 157
def type=(val)
  attributes['type'] = val
end