Class: Quandl::Command::Tasks::Download

Inherits:
Quandl::Command::Task show all
Defined in:
lib/quandl/command/tasks/download.rb

Constant Summary

Constants included from Quandl::Command::Task::Updatable

Quandl::Command::Task::Updatable::VERSION_URL

Instance Method Summary collapse

Methods included from Quandl::Command::Task::Inputable

#args_or_stdin, #each_line_in_background, #file_or_stdin

Methods included from Quandl::Command::Task::Reportable

#ask_to_send_crash_reports, #call

Methods included from Quandl::Command::Task::Clientable

#current_user

Methods included from Quandl::Command::Task::Updatable

#check_for_update, #check_for_update_once_daily

Methods included from Quandl::Command::Task::Threading

#await_thread_pool_lock!, #background_job, #exiting?, #force_load_json_support, #mutex, #obtain_thread_pool_lock, #release_thread_pool_lock, #shutdown_thread_pool_on_sigint, #thread_pool, #thread_pool_locked?, #thread_pool_locks, #threads, #threads?

Methods included from Quandl::Command::Task::Presentation

#present

Methods included from Quandl::Command::Task::Logging

#configure_logger, #debug, #error, #fatal, #info, #initialize_logger, #log_request_time, #logger, #start_request_timer, #stderr_logger, #summarize, #summarize_hash, #table

Methods included from Quandl::Command::Task::Commandable

#initialize

Methods included from Quandl::Command::Task::Validations

#run_task_validations!

Methods included from Quandl::Command::Task::Callbacks

#call

Methods included from Quandl::Command::Task::Configurable

#ask_for_confirmation!, #config, #confirmed?, #declared_params, #force_yes?, #page, #trace?, #verbose?

Instance Method Details

#executeObject



33
34
35
36
37
38
39
40
41
42
# File 'lib/quandl/command/tasks/download.rb', line 33

def execute
  each_line_in_background( args_or_stdin ) do |code|
    # find dataset
    dataset = Quandl::Client::Dataset.find( code )
    # apply filters
    dataset.data.assign_attributes(declared_params) if dataset.try(:exists?)
    # present
    present dataset, output_format: :qdf
  end
end