Class: Switchboard::Commands::Roster::Remove
- Inherits:
-
Switchboard::Command
- Object
- Switchboard::Command
- Switchboard::Commands::Roster::Remove
- Defined in:
- lib/switchboard/commands/roster/remove.rb
Class Method Summary collapse
Methods inherited from Switchboard::Command
description, help, options, to_command, to_command_name
Class Method Details
.run! ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/switchboard/commands/roster/remove.rb', line 7 def self.run! switchboard = Switchboard::Client.new(Switchboard::Settings.new, false) switchboard.on_roster_loaded do ARGV.each do |jid| if (items = roster.find(jid)).any? item = items.values.first puts "Removing #{item.jid.to_s} from my roster..." item.remove end end end switchboard.run! end |