Class: CemAcpt::Bolt::Cmd::TaskBase
- Defined in:
- lib/cem_acpt/bolt/cmd/task.rb
Overview
Base class for task commands
Constant Summary
Constants included from Logging
Instance Attribute Summary collapse
-
#item_defaults ⇒ Object
readonly
Returns the value of attribute item_defaults.
-
#sub_command ⇒ Object
readonly
Returns the value of attribute sub_command.
-
#task_name ⇒ Object
Returns the value of attribute task_name.
Attributes inherited from Base
Instance Method Summary collapse
- #cmd ⇒ Object
- #command_family ⇒ Object
-
#initialize(config, sub_command = nil, task_name = nil) ⇒ TaskBase
constructor
A new instance of TaskBase.
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_defaults ⇒ Object (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_command ⇒ Object (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_name ⇒ Object
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
#cmd ⇒ Object
32 33 34 |
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 32 def cmd join_array([bolt_bin, 'task', sub_command, task_name, ]) end |
#command_family ⇒ Object
28 29 30 |
# File 'lib/cem_acpt/bolt/cmd/task.rb', line 28 def command_family 'task' end |