Class: Localeapp::CLI::Rename
Instance Method Summary
collapse
Methods included from ApiCall
#api_call
Methods inherited from Command
#initialize, #initialize_config, #load_config_file, #set_command_line_arguments
Instance Method Details
#execute(current_name, new_name, *rest) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/localeapp/cli/rename.rb', line 6
def execute(current_name, new_name, *rest)
@output.puts "Localeapp mv"
@output.puts ""
@output.puts "Renaming key: #{current_name} to #{new_name}"
api_call :rename,
:url_options => { :current_name => current_name },
:payload => { :new_name => new_name },
:success => :report_success,
:failure => :report_failure,
:max_connection_attempts => 3
end
|
#report_failure(response) ⇒ Object
22
23
24
|
# File 'lib/localeapp/cli/rename.rb', line 22
def report_failure(response)
@output.puts "Failed!"
end
|
#report_success(response) ⇒ Object
18
19
20
|
# File 'lib/localeapp/cli/rename.rb', line 18
def report_success(response)
@output.puts "Success!"
end
|