Class: Jabber::Command::IqCommand

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.

### Methods

action action= actions new node node= sessionid sessionid= set_action set_node set_sessionid set_status status status=

### Public Class methods

new(node=nil, action=nil)

[Source]

        # 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

### Public Instance methods

action()

Get the action of the Command stanza

The following Symbols are allowed:

- :execute
- :cancel
- :prev
- :next
- :complete

return: | [Symbol] or nil

[Source]

        # 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

action=(v)

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

v: | [Symbol] or nil

[Source]

        # 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

actions()

Get the actions allowed

return: | [REXML::Element] or nil

[Source]

         # File lib/xmpp4r/command/iq/command.rb, line 148
    148:       def actions
    149:         first_element('actions')
    150:       end

node()

Get the node of the Command stanza

result: | [String] or nil

[Source]

        # File lib/xmpp4r/command/iq/command.rb, line 24
    24:       def node
    25:         attributes['node']
    26:       end

node=(v)

Set the node of the Command stanza

v: | [String] or nil

[Source]

        # File lib/xmpp4r/command/iq/command.rb, line 31
    31:       def node=(v)
    32:         attributes['node'] = v
    33:       end

sessionid()

Get the sessionid of the Command stanza

result: | [String] or nil

[Source]

        # File lib/xmpp4r/command/iq/command.rb, line 46
    46:       def sessionid
    47:         attributes['sessionid']
    48:       end

sessionid=(v)

Set the sessionid of the Command stanza

v: | [String] or nil

[Source]

        # File lib/xmpp4r/command/iq/command.rb, line 53
    53:       def sessionid=(v)
    54:         attributes['sessionid'] = v
    55:       end

set_action(v)

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

v: | [Symbol] or nil

[Source]

         # File lib/xmpp4r/command/iq/command.rb, line 103
    103:       def set_action(v)
    104:         self.action = v
    105:         self
    106:       end

set_node(v)

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

v: | [String] or nil

[Source]

        # File lib/xmpp4r/command/iq/command.rb, line 38
    38:       def set_node(v)
    39:         self.node = v
    40:         self
    41:       end

set_sessionid(v)

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

v: | [String] or nil

[Source]

        # File lib/xmpp4r/command/iq/command.rb, line 60
    60:       def set_sessionid(v)
    61:         self.sessionid = v
    62:         self
    63:       end

set_status(v)

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

v: | [Symbol] or nil

[Source]

         # File lib/xmpp4r/command/iq/command.rb, line 140
    140:       def set_status(v)
    141:         self.status = v
    142:         self
    143:       end

status()

Get the status of the Command stanza

The following Symbols are allowed:

- :executing
- :completed
- :canceled

return: | [Symbol] or nil

[Source]

         # 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

status=(v)

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

v: | [Symbol] or nil

[Source]

         # 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

[Validate]