class Blather::Stanza::Iq::S5b::StreamHostUsed

Stream host used stanza

Public Class Methods

new(jid) click to toggle source

Create a new S5b::StreamHostUsed

@overload new(node)

Create a new StreamHostUsed by inheriting an existing node
@param [XML::Node] node an XML::Node to inherit from

@overload new(opts)

Create a new StreamHostUsed through a hash of options
@param [Hash] opts a hash options
@option opts [Blather::JID, String] :jid the JID of the StreamHostUsed

@overload new(jid)

Create a new StreamHostUsed
@param [Blather::JID, String] jid the JID of the StreamHostUsed
Calls superclass method
# File lib/blather/stanza/iq/s5b.rb, line 173
def self.new(jid)
  new_node = super 'streamhost-used'

  case jid
  when Nokogiri::XML::Node
    new_node.inherit jid
  when Hash
    new_node.jid = jid[:jid]
  else
    new_node.jid = jid
  end
  new_node
end

Public Instance Methods

jid() click to toggle source

Get the jid of the used streamhost

@return [Blather::JID, nil]

# File lib/blather/stanza/iq/s5b.rb, line 190
def jid
  if j = read_attr(:jid)
    JID.new(j)
  else
    nil
  end
end
jid=(j) click to toggle source

Set the jid of the used streamhost

@param [Blather::JID, String, nil]

# File lib/blather/stanza/iq/s5b.rb, line 201
def jid=(j)
  write_attr :jid, (j ? j.to_s : nil)
end