Class: JabberAdmin::Commands::SendDirectInvitation

Inherits:
Object
  • Object
show all
Defined in:
lib/jabber_admin/commands/send_direct_invitation.rb

Overview

Send a direct invitation to several destinations.

Class Method Summary collapse

Class Method Details

.call(callable, room:, users:, password: '', reason: '') ⇒ Object

Pass the correct data to the given callable.

Parameters:

  • callable (Proc, #call)

    the callable to call

  • room (String)

    room JID (eg. [email protected])

  • users (Array<String>)

    user JIDs wo/ resource (eg. tom@localhost)

  • password (String) (defaults to: '')

    a optional room password

  • reason (String) (defaults to: '')

    the reason for the invitation



17
18
19
20
21
22
23
24
25
# File 'lib/jabber_admin/commands/send_direct_invitation.rb', line 17

def self.call(callable, room:, users:, password: '', reason: '')
  name, service = room.split('@')
  callable.call('send_direct_invitation',
                name: name,
                service: service,
                password: password,
                reason: reason,
                users: users.join(':'))
end