Class: CemAcpt::Bolt::Cmd::TaskBase

Inherits:
Base
  • Object
show all
Defined in:
lib/cem_acpt/bolt/cmd/task.rb

Overview

Base class for task commands

Direct Known Subclasses

TaskRun, TaskShow

Constant Summary

Constants included from Logging

Logging::LEVEL_MAP

Instance Attribute Summary collapse

Attributes inherited from Base

#cmd_env, #cmd_params

Instance Method Summary collapse

Methods inherited from Base

#add_cmd_env, #add_cmd_param, #bolt_bin, #inspect, option, option_names, #options, #run, supports_params, #to_s

Methods included from Logging

current_log_config, #current_log_config, current_log_format, #current_log_format, current_log_level, #current_log_level, included, logger, #logger, new_log_config, #new_log_config, new_log_formatter, #new_log_formatter, new_log_level, #new_log_level, new_logger, #new_logger, verbose?, #verbose?

Constructor Details

#initialize(config, sub_command = nil, task_name = nil) ⇒ TaskBase

Returns a new instance of TaskBase.



17
18
19
20
21
22
23
24
25
26
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 17

def initialize(config, sub_command = nil, task_name = nil)
  @config = config
  @sub_command = sub_command
  @task_name = task_name
  @item_defaults = {
    'action' => 'task',
    'object' => @task_name,
  }
  super()
end

Instance Attribute Details

#item_defaultsObject (readonly)

Returns the value of attribute item_defaults.



11
12
13
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 11

def item_defaults
  @item_defaults
end

#sub_commandObject (readonly)

Returns the value of attribute sub_command.



11
12
13
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 11

def sub_command
  @sub_command
end

#task_nameObject

Returns the value of attribute task_name.



10
11
12
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 10

def task_name
  @task_name
end

Instance Method Details

#cmdObject



32
33
34
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 32

def cmd
  join_array([bolt_bin, 'task', sub_command, task_name, options])
end

#command_familyObject



28
29
30
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 28

def command_family
  'task'
end