class Jabber::Command::IqCommand

Class for handling ad-hoc commands (JEP 0050)

A command is uniquely identified by its node attribute.

Public Class Methods

new(node=nil, action=nil) click to toggle source
Calls superclass method
# File lib/xmpp4r/command/iq/command.rb, line 15
def initialize(node=nil, action=nil)
  super()
  set_node(node)
  set_action(action)
end

Public Instance Methods

action() click to toggle source

Get the action of the Command stanza

The following Symbols are allowed:

  • :execute

  • :cancel

  • :prev

  • :next

  • :complete

return
Symbol

or nil

# File lib/xmpp4r/command/iq/command.rb, line 75
def action
  case attributes['action']
    when 'execute' then :execute
    when 'cancel' then :cancel
    when 'prev' then :prev
    when 'next' then :next
    when 'complete' then :complete
    else nil
  end
end
action=(v) click to toggle source

Set the action of the Command stanza (see #action for details)

v
Symbol

or nil

# File lib/xmpp4r/command/iq/command.rb, line 89
def action=(v)
  attributes['action'] = case v
    when :execute then 'execute'
    when :cancel then 'cancel'
    when :prev then 'prev'
    when :next then 'next'
    when :complete then 'complete'
    else nil
  end
end
actions() click to toggle source

Get the actions allowed

return
REXML::Element

or nil

# File lib/xmpp4r/command/iq/command.rb, line 148
def actions
  first_element('actions')
end
node() click to toggle source

Get the node of the Command stanza

result
String

or nil

# File lib/xmpp4r/command/iq/command.rb, line 24
def node
  attributes['node']
end
node=(v) click to toggle source

Set the node of the Command stanza

v
String

or nil

# File lib/xmpp4r/command/iq/command.rb, line 31
def node=(v)
  attributes['node'] = v
end
sessionid() click to toggle source

Get the sessionid of the Command stanza

result
String

or nil

# File lib/xmpp4r/command/iq/command.rb, line 46
def sessionid
  attributes['sessionid']
end
sessionid=(v) click to toggle source

Set the sessionid of the Command stanza

v
String

or nil

# File lib/xmpp4r/command/iq/command.rb, line 53
def sessionid=(v)
  attributes['sessionid'] = v
end
set_action(v) click to toggle source

Set the action of the Command stanza (chaining-friendly)

v
Symbol

or nil

# File lib/xmpp4r/command/iq/command.rb, line 103
def set_action(v)
  self.action = v
  self
end
set_node(v) click to toggle source

Set the node of the Command stanza (chaining-friendly)

v
String

or nil

# File lib/xmpp4r/command/iq/command.rb, line 38
def set_node(v)
  self.node = v
  self
end
set_sessionid(v) click to toggle source

Set the sessionid of the Command stanza (chaining-friendly)

v
String

or nil

# File lib/xmpp4r/command/iq/command.rb, line 60
def set_sessionid(v)
  self.sessionid = v
  self
end
set_status(v) click to toggle source

Set the status of the Command stanza (chaining-friendly)

v
Symbol

or nil

# File lib/xmpp4r/command/iq/command.rb, line 140
def set_status(v)
  self.status = v
  self
end
status() click to toggle source

Get the status of the Command stanza

The following Symbols are allowed:

  • :executing

  • :completed

  • :canceled

return
Symbol

or nil

# File lib/xmpp4r/command/iq/command.rb, line 116
def status
  case attributes['status']
    when 'executing' then :executing
    when 'completed' then :completed
    when 'canceled' then :canceled
    else nil
  end
end
status=(v) click to toggle source

Set the status of the Command stanza (see #status for details)

v
Symbol

or nil

# File lib/xmpp4r/command/iq/command.rb, line 128
def status=(v)
  attributes['status'] = case v
    when :executing then 'executing'
    when :completed then 'completed'
    when :canceled then 'canceled'
    else nil
  end
end