Class: AnswersEngine::CLI::JobOutput
- Inherits:
-
Thor
- Object
- Thor
- AnswersEngine::CLI::JobOutput
- Defined in:
- lib/answersengine/cli/job_output.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
6 7 8 |
# File 'lib/answersengine/cli/job_output.rb', line 6 def self.(command, namespace = nil, subcommand = false) "#{basename} #{@package_name} #{command.usage}" end |
Instance Method Details
#collections(scraper_name) ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/answersengine/cli/job_output.rb', line 55 def collections(scraper_name) if [:job] client = Client::JobOutput.new() puts "#{client.collections(options[:job])}" else client = Client::ScraperJobOutput.new() puts "#{client.collections(scraper_name)}" end end |
#list(scraper_name) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/answersengine/cli/job_output.rb', line 19 def list(scraper_name) collection = .fetch(:collection) { 'default' } if [:job] client = Client::JobOutput.new() puts "#{client.all(options[:job], collection)}" else client = Client::ScraperJobOutput.new() puts "#{client.all(scraper_name, collection)}" end end |
#show(scraper_name, id) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/answersengine/cli/job_output.rb', line 37 def show(scraper_name, id) collection = .fetch(:collection) { 'default' } if [:job] client = Client::JobOutput.new() puts "#{client.find(options[:job], collection, id)}" else client = Client::ScraperJobOutput.new() puts "#{client.find(scraper_name, collection, id)}" end end |