Class: Localeapp::CLI::Remove

Inherits:
Command
  • Object
show all
Includes:
ApiCall
Defined in:
lib/localeapp/cli/remove.rb

Instance Method Summary collapse

Methods included from ApiCall

#api_call

Methods inherited from Command

#initialize, #initialize_config, #load_config_file, #set_command_line_arguments

Constructor Details

This class inherits a constructor from Localeapp::CLI::Command

Instance Method Details

#execute(key, *rest) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/localeapp/cli/remove.rb', line 6

def execute(key, *rest)
  @output.puts "Localeapp rm"
  @output.puts ""
  @output.puts "Remove key: #{key}"
  api_call :remove,
    :url_options => { :key => key },
    :success => :report_success,
    :failure => :report_failure,
    :max_connection_attempts => 3
end

#report_failure(response) ⇒ Object



21
22
23
# File 'lib/localeapp/cli/remove.rb', line 21

def report_failure(response)
  @output.puts "Failed!"
end

#report_success(response) ⇒ Object



17
18
19
# File 'lib/localeapp/cli/remove.rb', line 17

def report_success(response)
  @output.puts "Success!"
end