Class: A2::Subcommand::Team::Delete

Inherits:
CmdParse::Command
  • Object
show all
Includes:
Approved
Defined in:
lib/a2/subcommands/team.rb

Instance Method Summary collapse

Methods included from Approved

#add_approval_option!, #ask_for_approval, #with_approval

Constructor Details

#initializeDelete

Returns a new instance of Delete.



51
52
53
54
# File 'lib/a2/subcommands/team.rb', line 51

def initialize
  super('delete-team', takes_commands: false)
  @opt = add_approval_option!(options)
end

Instance Method Details

#execute(id) ⇒ Object



56
57
58
59
60
# File 'lib/a2/subcommands/team.rb', line 56

def execute(id)
  with_approval(message: "delete team #{id}", auto_approved: @opt[:auto_approved]) do
    puts JSON.pretty_generate(A2::Client.new(command_parser.data).delete_team(id))
  end
end