class NeverBounce::CLI::Script::JobsParse

Attributes

auto_start[W]

Public Instance Methods

auto_start() click to toggle source

@return [true] @return [false] @return [nil]

# File lib/never_bounce/cli/script/jobs_parse.rb, line 19
def auto_start
  igetset(:auto_start) do
    if env.has_key?(k = "AUTO_START")
      env_truthy?(k)
    end
  end
end
manifest() click to toggle source

@!attribute manifest @return [Manifest]

# File lib/never_bounce/cli/script/jobs_parse.rb, line 42
def manifest
  @manifest ||= Manifest.new(
    name: "nb-jobs-parse",
    function: "Issue a job parse command to the server",
    cmdline: "[options] [VAR1=value] [VAR2=value] ...",
  )
end
request() click to toggle source

An API::Request::JobsParse. @!attribute request @return [Object]

# File lib/never_bounce/cli/script/jobs_parse.rb, line 30
def request
  @request ||= API::Request::JobsParse.new({
    api_key: api_key,
    auto_start: auto_start,
    job_id: job_id,
  })
end
slim_main() click to toggle source

@return [Integer]

# File lib/never_bounce/cli/script/jobs_parse.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