Class: A2::Subcommand::User::Delete
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- A2::Subcommand::User::Delete
- Includes:
- Approved
- Defined in:
- lib/a2/subcommands/user.rb
Instance Method Summary collapse
- #execute(id) ⇒ Object
-
#initialize ⇒ Delete
constructor
A new instance of Delete.
Methods included from Approved
#add_approval_option!, #ask_for_approval, #with_approval
Constructor Details
#initialize ⇒ Delete
Returns a new instance of Delete.
51 52 53 54 |
# File 'lib/a2/subcommands/user.rb', line 51 def initialize super('delete-user', takes_commands: false) @opt = add_approval_option!() end |
Instance Method Details
#execute(id) ⇒ Object
56 57 58 59 60 |
# File 'lib/a2/subcommands/user.rb', line 56 def execute(id) with_approval(message: "delete user #{id}", auto_approved: @opt[:auto_approved]) do puts JSON.pretty_generate(A2::Client.new(command_parser.data).delete_user(id)) end end |