class Datahen::CLI::ScraperJob

Public Class Methods

banner(command, namespace = nil, subcommand = false) click to toggle source

Public Instance Methods

cancel(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 41
def cancel(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.cancel(options[:job])}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.cancel(scraper_name)}"
  end
end
delete(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 56
def delete(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.delete(options[:job])}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.delete(scraper_name)}"
  end
end
list(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 30
def list(scraper_name)
  client = Client::ScraperJob.new(options)
  puts "#{client.all(scraper_name)}"
end
pause(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 87
def pause(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.pause(options[:job], options)}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.pause(scraper_name, options)}"
  end
end
profile(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 125
def profile(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.profile(options[:job])}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.profile(scraper_name)}"
  end
end
resume(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 71
def resume(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.resume(options[:job])}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.resume(scraper_name)}"
  end
end
show(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 12
def show(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.find(options[:job], options)}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.find(scraper_name, options)}"
  end
end
update(scraper_name) click to toggle source
# File lib/datahen/cli/scraper_job.rb, line 110
def update(scraper_name)
  if options[:job]
    client = Client::Job.new(options)
    puts "#{client.update(options[:job], options)}"
  else
    client = Client::ScraperJob.new(options)
    puts "#{client.update(scraper_name, options)}"
  end
end