Class: Datahen::CLI::ScraperTask
- Inherits:
-
Thor
- Object
- Thor
- Datahen::CLI::ScraperTask
- Defined in:
- lib/datahen/cli/scraper_task.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
5 6 7 |
# File 'lib/datahen/cli/scraper_task.rb', line 5 def self.(command, namespace = nil, subcommand = false) "#{basename} #{@package_name} #{command.usage}" end |
Instance Method Details
#list(scraper_name) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/datahen/cli/scraper_task.rb', line 19 def list(scraper_name) if [:job] client = Client::JobTask.new() puts "#{client.all([:job])}" else client = Client::ScraperTask.new() puts "#{client.all(scraper_name)}" end end |
#show(scraper_name, task_id) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/datahen/cli/scraper_task.rb', line 35 def show(scraper_name, task_id) if [:job] client = Client::JobTask.new() puts "#{client.find([:job], task_id)}" else client = Client::ScraperTask.new() puts "#{client.find(scraper_name, task_id)}" end end |