Class: JabberAdmin::Commands::GetRoomAffiliations

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

Overview

Get room affiliations.

Class Method Summary collapse

Class Method Details

.call(callable, room:) ⇒ Object

Pass the correct data to the given callable.

Parameters:



13
14
15
16
17
18
19
20
21
22
# File 'lib/jabber_admin/commands/get_room_affiliations.rb', line 13

def self.call(callable, room:)
  name, service = room.split('@')
  res = callable.call('get_room_affiliations', check_res_body: false,
                                               name: name,
                                               service: service)

  # An empty body carries no affiliations to parse
  body = res.body.to_s
  body.empty? ? nil : JSON.parse(body)
end