Class: Quandl::Command::Tasks::List
- Defined in:
- lib/quandl/command/tasks/list.rb
Instance Attribute Summary
Attributes inherited from Base
#args, #options, #request_timer
Instance Method Summary collapse
Methods inherited from Base
#ask_yes_or_no, authenticated_users_only!, call, #call, command_name, configure, #current_user, #debug, description, disable!, disabled?, #error, #fatal, #force_yes?, #info, #initialize, #logger, options, #summarize, #summarize_hash, syntax, #table, #verbose?, warn_unauthenticated_users
Constructor Details
This class inherits a constructor from Quandl::Command::Tasks::Base
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/quandl/command/tasks/list.rb', line 17 def execute # find dataset debug "search_params: #{search_params}" dataset = Quandl::Client::Dataset.where( search_params ).fetch codes = dataset.collect(&:full_code) # fail on errors info codes.join("\n") end |
#page ⇒ Object
36 37 38 |
# File 'lib/quandl/command/tasks/list.rb', line 36 def page .page.to_i || 1 end |
#search_params ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/quandl/command/tasks/list.rb', line 26 def search_params search_params = {} search_params[:query] = .match if .match.present? search_params[:source_code] = .source_code.to_s.upcase if .source_code.present? search_params[:per_page] = .limit if .limit.present? search_params[:page] = page search_params[:self_search] = search_params[:source_code].present? ? false : true search_params end |