Class: Pvectl::Commands::EditContainer
- Inherits:
-
Object
- Object
- Pvectl::Commands::EditContainer
- Includes:
- EditResourceCommand
- Defined in:
- lib/pvectl/commands/edit_container.rb,
sig/pvectl/commands/edit_container.rbs
Overview
Handler for the pvectl edit container command.
Includes EditResourceCommand for shared workflow and overrides template methods with container-specific behavior.
Instance Method Summary collapse
-
#build_edit_service(connection) ⇒ Services::EditContainer
Builds the container edit service.
-
#execute_params(resource_id) ⇒ Hash
Builds execution parameters from a container ID.
-
#resource_id_label ⇒ String
Human label for container IDs.
-
#resource_label ⇒ String
Human label for container resources.
Methods included from EditResourceCommand
#build_editor_session, #display_diff, #execute, included, #initialize, #load_config, #service_options, #usage_error
Instance Method Details
#build_edit_service(connection) ⇒ Services::EditContainer
Builds the container edit service.
46 47 48 49 50 51 52 53 |
# File 'lib/pvectl/commands/edit_container.rb', line 46 def build_edit_service(connection) ct_repo = Pvectl::Repositories::Container.new(connection) Pvectl::Services::EditContainer.new( container_repository: ct_repo, editor_session: build_editor_session, options: ) end |
#execute_params(resource_id) ⇒ Hash
Builds execution parameters from a container ID.
38 39 40 |
# File 'lib/pvectl/commands/edit_container.rb', line 38 def execute_params(resource_id) { ctid: resource_id.to_i } end |
#resource_id_label ⇒ String
Returns human label for container IDs.
30 31 32 |
# File 'lib/pvectl/commands/edit_container.rb', line 30 def resource_id_label "CTID" end |
#resource_label ⇒ String
Returns human label for container resources.
25 26 27 |
# File 'lib/pvectl/commands/edit_container.rb', line 25 def resource_label "container" end |