Module: Pvectl::Commands::CreateResourceCommand Abstract
- Included in:
- CreateContainer, CreateVm
- Defined in:
- lib/pvectl/commands/create_resource_command.rb
Overview
This module is abstract.
Include this module and implement template methods.
Shared functionality for resource creation commands.
Template method pattern: provides common create workflow (interactive detection, confirmation, dry-run, config loading) while specialization classes define resource-specific hooks.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ Object
Hook called when module is included.
Instance Method Summary collapse
-
#execute ⇒ Integer
Executes the create command.
-
#initialize(args, options, global_options) ⇒ Object
Initializes a create command.
Class Method Details
.included(base) ⇒ Object
Hook called when module is included.
39 40 41 |
# File 'lib/pvectl/commands/create_resource_command.rb', line 39 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#execute ⇒ Integer
Executes the create command.
57 58 59 60 61 62 63 |
# File 'lib/pvectl/commands/create_resource_command.rb', line 57 def execute if interactive_mode? perform_interactive else perform_create end end |
#initialize(args, options, global_options) ⇒ Object
Initializes a create command.
48 49 50 51 52 |
# File 'lib/pvectl/commands/create_resource_command.rb', line 48 def initialize(args, , ) @args = args @options = @global_options = end |