Class: JabberAdmin::Commands::SetNickname

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

Overview

Set nickname in a user’s vCard.

Class Method Summary collapse

Class Method Details

.call(callable, user:, nick:) ⇒ Object

Pass the correct data to the given callable.

Parameters:

  • callable (Proc, #call)

    the callable to call

  • user (String)

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

  • nick (String)

    the user nickname (eg. TomTom)



14
15
16
17
18
19
# File 'lib/jabber_admin/commands/set_nickname.rb', line 14

def self.call(callable, user:, nick:)
  uid, host = user.split('@')
  callable.call(
    'set_nickname', user: uid, host: host, nickname: nick
  )
end