class Commands::Remove

Public Class Methods

command_name() click to toggle source
# File lib/gdsh/remove.rb, line 5
def self.command_name
  'rm'
end
function() click to toggle source
# File lib/gdsh/remove.rb, line 13
def self.function
  'Removes the file.'
end
new(client, params) click to toggle source
Calls superclass method Commands::Command::new
# File lib/gdsh/remove.rb, line 17
def initialize(client, params)
  super(client, params)
  @file_id = @params[1]
end
parameters() click to toggle source
# File lib/gdsh/remove.rb, line 9
def self.parameters
  '(<file_id>)'
end

Public Instance Methods

execute() click to toggle source
# File lib/gdsh/remove.rb, line 22
def execute
  drive = @client.discovered_api('drive', 'v2')
  result = @client.execute(
    api_method: drive.files.trash,
    parameters: { fileId: @file_id })
  if result.status != 200
    puts drive_error_string
  else
    puts 'Deleted.'.colorize(:green)
  end
end