Class: JabberAdmin::Commands::CreateRoomWithOpts

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

Overview

Create a new room (MUC) with additional options.

Class Method Summary collapse

Class Method Details

.call(callable, room:, host:, **options) ⇒ Object

Pass the correct data to the given callable.

Parameters:

  • callable (Proc, #call)

    the callable to call

  • room (String)

    room JID (eg. [email protected])

  • host (String)

    the jabber host (eg. localhost)

  • options

    pass additional symbol: value pairs



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

def self.call(callable, room:, host:, **options)
  name, service = room.split('@')
  options = options.map do |key, value|
    { 'name' => key.to_s, 'value' => value.to_s }
  end

  callable.call('create_room_with_opts',
                name: name,
                service: service,
                host: host,
                options: options)
end