Class: NeverBounce::CLI::Script::JobsStart
- Inherits:
-
RequestMaker
- Object
- Base
- Meaningful
- RequestMaker
- NeverBounce::CLI::Script::JobsStart
- Defined in:
- lib/never_bounce/cli/script/jobs_start.rb
Constant Summary
Constants inherited from RequestMaker
Instance Attribute Summary collapse
- #manifest ⇒ Manifest
-
#request ⇒ Object
An
API::Request::JobsStart
. - #run_sample ⇒ true, ...
Attributes inherited from RequestMaker
#api_key, #api_url, #request_curl, #response, #server_raw, #session, #user_config
Attributes inherited from Meaningful
#banner_text, #envar_text, #help_text, #options_text
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from RequestMaker
#get_table_value, #inil, #print_curl_request, #print_error_response, #print_server_raw, #slim_main1
Methods inherited from Meaningful
#call_slim_main, error_klasses, format_envar_examples, #handle_help_and_options, #help?, #main, #option_parser, #options
Methods inherited from Base
#env_falsey?, #env_truthy?, env_value_truthy?, #main, #system, #verbose?
Instance Attribute Details
#manifest ⇒ Manifest
42 43 44 45 46 47 48 |
# File 'lib/never_bounce/cli/script/jobs_start.rb', line 42 def manifest @manifest ||= Manifest.new( name: "nb-jobs-start", function: "Start a job created with `auto_start` disabled", cmdline: "[options] [VAR1=value] [VAR2=value] ...", ) end |
#request ⇒ Object
An API::Request::JobsStart
.
30 31 32 33 34 35 36 |
# File 'lib/never_bounce/cli/script/jobs_start.rb', line 30 def request @request ||= API::Request::JobsStart.new({ api_key: api_key, job_id: job_id, run_sample: run_sample, }) end |
#run_sample ⇒ true, ...
19 20 21 22 23 24 25 |
# File 'lib/never_bounce/cli/script/jobs_start.rb', line 19 def run_sample igetset(:run_sample) do if env.has_key?(k = "RUN_SAMPLE") env_truthy?(k) end end end |
Instance Method Details
#slim_main ⇒ Integer
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/never_bounce/cli/script/jobs_start.rb', line 53 def slim_main "Response".tap do |label| headings = [ ["QueueId", :queue_id], ["ExecTime", :execution_time, :right], ] table = Table.new( headings: headings.map { |ar| ar[0] }, rows: [headings.map { |ar| get_table_value(response, ar) }], ).align!(headings) stdout.puts "\n#{label}:" stdout.puts table end 0 end |