Class for handling ad-hoc commands (JEP 0050)
A command is uniquely identified by its node attribute.
# File lib/xmpp4r/command/iq/command.rb, line 15 def initialize(node=nil, action=nil) super() set_node(node) set_action(action) end
Get the action of the Command stanza
The following Symbols are allowed:
:execute
:cancel
:prev
:next
:complete
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
Set the action of the Command stanza (see #action for details)
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
Get the actions allowed
or nil
# File lib/xmpp4r/command/iq/command.rb, line 148 def actions first_element('actions') end
Get the node of the Command stanza
or nil
# File lib/xmpp4r/command/iq/command.rb, line 24 def node attributes['node'] end
Set the node of the Command stanza
or nil
# File lib/xmpp4r/command/iq/command.rb, line 31 def node=(v) attributes['node'] = v end
Get the sessionid of the Command stanza
or nil
# File lib/xmpp4r/command/iq/command.rb, line 46 def sessionid attributes['sessionid'] end
Set the sessionid of the Command stanza
or nil
# File lib/xmpp4r/command/iq/command.rb, line 53 def sessionid=(v) attributes['sessionid'] = v end
Set the action of the Command stanza (chaining-friendly)
or nil
# File lib/xmpp4r/command/iq/command.rb, line 103 def set_action(v) self.action = v self end
Set the node of the Command stanza (chaining-friendly)
or nil
# File lib/xmpp4r/command/iq/command.rb, line 38 def set_node(v) self.node = v self end
Set the sessionid of the Command stanza (chaining-friendly)
or nil
# File lib/xmpp4r/command/iq/command.rb, line 60 def set_sessionid(v) self.sessionid = v self end
Set the status of the Command stanza (chaining-friendly)
or nil
# File lib/xmpp4r/command/iq/command.rb, line 140 def set_status(v) self.status = v self end
Get the status of the Command stanza
The following Symbols are allowed:
:executing
:completed
:canceled
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