Class: Looks::Command::Rm

Inherits:
AccountManagement show all
Defined in:
lib/looks/command/rm.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from AccountManagement

#configure

Methods inherited from Base

#initialize, #run, #to_s, #usage

Constructor Details

This class inherits a constructor from Looks::Command::Base

Instance Method Details

#argumentsObject



8
9
10
# File 'lib/looks/command/rm.rb', line 8

def arguments
  [ '<id>' ]
end

#execute(args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/looks/command/rm.rb', line 12

def execute(args)
  super

  id = args.first

  begin
    Gravatar::Account.new(config).remove(id)
  rescue Gravatar::IncorrectMethodParameterError
    raise Error, "#{id}: Unknown identifier"
  end
end