Method: Ayadn::Action#files

Defined in:
lib/ayadn/action.rb

#files(options) ⇒ Object



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/ayadn/action.rb', line 359

def files(options)
  begin
    get_files = lambda { @api.get_files_list(options) }
    if options[:raw]
      @view.show_raw(get_files.call)
    else
      @view.downloading
      list = get_files.call
      Errors.no_data('files') if list.empty?
      @view.clear_screen
      @view.show_files_list(list)
    end
  rescue => e
    Errors.global_error({error: e, caller: caller, data: [options]})
  end
end