Class | Jabber::Command::IqCommand |
In: |
lib/xmpp4r/command/iq/command.rb
|
Parent: | Iq |
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 15: def initialize(node=nil, action=nil) 16: super() 17: set_node(node) 18: set_action(action) 19: end
Get the action of the Command stanza
The following Symbols are allowed:
return: | [Symbol] or nil |
# File lib/xmpp4r/command/iq/command.rb, line 75 75: def action 76: case attributes['action'] 77: when 'execute' then :execute 78: when 'cancel' then :cancel 79: when 'prev' then :prev 80: when 'next' then :next 81: when 'complete' then :complete 82: else nil 83: end 84: end
Set the action of the Command stanza (see IqCommand#action for details)
v: | [Symbol] or nil |
# File lib/xmpp4r/command/iq/command.rb, line 89 89: def action=(v) 90: attributes['action'] = case v 91: when :execute then 'execute' 92: when :cancel then 'cancel' 93: when :prev then 'prev' 94: when :next then 'next' 95: when :complete then 'complete' 96: else nil 97: end 98: end
Get the actions allowed
return: | [REXML::Element] or nil |
# File lib/xmpp4r/command/iq/command.rb, line 148 148: def actions 149: first_element('actions') 150: end
Get the status of the Command stanza
The following Symbols are allowed:
return: | [Symbol] or nil |
# File lib/xmpp4r/command/iq/command.rb, line 116 116: def status 117: case attributes['status'] 118: when 'executing' then :executing 119: when 'completed' then :completed 120: when 'canceled' then :canceled 121: else nil 122: end 123: end
Set the status of the Command stanza (see IqCommand#status for details)
v: | [Symbol] or nil |
# File lib/xmpp4r/command/iq/command.rb, line 128 128: def status=(v) 129: attributes['status'] = case v 130: when :executing then 'executing' 131: when :completed then 'completed' 132: when :canceled then 'canceled' 133: else nil 134: end 135: end