Sha256: ce1ec01cac088a374823c21c63bfe332fa8c1d6316f4668438b0156f0d1c583c

Contents?: true

Size: 840 Bytes

Versions: 2

Compression:

Stored size: 840 Bytes

Contents

class Quandl::Command::Tasks::Delete < Quandl::Command::Task
  
  autoload_quandl_client
  authenticated_users_only!
  
  description "Delete a dataset by its quandl code."
  syntax %Q{quandl delete (SOURCE_CODE/)CODE

    EXAMPLES:

      $ quandl delete TEST
      Are you sure? (y/n)
      
      $ quandl delete TEST TEST2 TEST3 --force-yes
      Deleted | 164ms | TEST
      Deleted | 134ms | TEST2
      Deleted | 124ms | TEST3
      
      $ quandl list --match TEST | quandl delete --force-yes
    
      $ cat ids.txt | quandl delete --force-yes}

  def execute
    each_line_in_background( args_or_stdin ) do |code|
      # find
      dataset = Quandl::Client::Dataset.find( code )
      # destroy
      dataset.destroy if dataset.respond_to?(:destroy) && dataset.exists?
      # present
      present dataset
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quandl-0.3.3 lib/quandl/command/tasks/delete.rb
quandl-0.3.0 lib/quandl/command/tasks/delete.rb