Class: Datahen::CLI::ScraperResource

Inherits:
Thor
  • Object
show all
Defined in:
lib/datahen/cli/scraper_resource.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



5
6
7
# File 'lib/datahen/cli/scraper_resource.rb', line 5

def self.banner(command, namespace = nil, subcommand = false)
  "#{basename} #{@package_name} #{command.usage}"
end

Instance Method Details

#listObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/datahen/cli/scraper_resource.rb', line 18

def list()
  if options[:job]
    client = Client::JobResource.new(options)
    puts "#{client.all(options[:job])}"
  else
    if options[:scraper_name]
      client = Client::ScraperResource.new(options)
      puts "#{client.all(options[:scraper_name])}"
    else
      puts 'Must specify either a job ID or a scraper name'
    end
  end
end